

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>Librados (C 接口) &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="LibradosPP (C++)" href="../libradospp/" />
    <link rel="prev" title="librados 简介" href="../librados-intro/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../">Ceph 存储集群</a></li>
          <li class="breadcrumb-item"><a href="../">Ceph 存储集群 API</a></li>
      <li class="breadcrumb-item active">Librados (C 接口)</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/rados/api/librados.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../configuration/">配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../operations/">运维</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/">    手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../troubleshooting/">故障排除</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../">APIs</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../librados-intro/">librados 简介</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">librados (C)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">实例：连接并写入一个对象</a></li>
<li class="toctree-l4"><a class="reference internal" href="#io">异步 IO</a></li>
<li class="toctree-l4"><a class="reference internal" href="#api">API 调用</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../libradospp/">librados (C++)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../python/">librados (Python)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../libcephsqlite/">libcephsqlite (SQLite)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../objclass-sdk/">object class</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="librados-c">
<h1>Librados (C 接口)<a class="headerlink" href="#librados-c" title="Permalink to this heading"></a></h1>
<p><cite>librados</cite> 提供了 RADOS 服务的底层访问功能， RADOS 概览参见<a class="reference internal" href="../../../architecture/"><span class="doc">体系结构</span></a>。</p>
<section id="id1">
<h2>实例：连接并写入一个对象<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h2>
<p>要使用 <cite>Librados</cite> ，先实例化一个 <a class="reference internal" href="#c.rados_t" title="rados_t"><code class="xref c c-type docutils literal notranslate"><span class="pre">rados_t</span></code></a> 变量（集群句柄）、再用指向它的指针调用 c:func:<cite>rados_create()</cite> ：</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">int</span><span class="w"> </span><span class="n">err</span><span class="p">;</span>
<span class="n">rados_t</span><span class="w"> </span><span class="n">cluster</span><span class="p">;</span>

<span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rados_create</span><span class="p">(</span><span class="o">&amp;</span><span class="n">cluster</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;%s: cannot create a cluster handle: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="w"> </span><span class="n">strerror</span><span class="p">(</span><span class="o">-</span><span class="n">err</span><span class="p">));</span>
<span class="w">        </span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<p>然后配置 <a class="reference internal" href="#c.rados_t" title="rados_t"><code class="xref c c-type docutils literal notranslate"><span class="pre">rados_t</span></code></a> 以连接集群，可以挨个配置（ <a class="reference internal" href="#c.rados_conf_set" title="rados_conf_set"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_conf_set()</span></code></a> ）、或用配置文件（ <a class="reference internal" href="#c.rados_conf_read_file" title="rados_conf_read_file"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_conf_read_file()</span></code></a> ）、或命令行选项（ <a class="reference internal" href="#c.rados_conf_parse_argv" title="rados_conf_parse_argv"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_conf_parse_argv()</span></code></a> ）、或环境变量（ <a class="reference internal" href="#c.rados_conf_parse_env" title="rados_conf_parse_env"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_conf_parse_env()</span></code></a> ）：</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rados_conf_read_file</span><span class="p">(</span><span class="n">cluster</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;/path/to/myceph.conf&quot;</span><span class="p">);</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;%s: cannot read config file: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="w"> </span><span class="n">strerror</span><span class="p">(</span><span class="o">-</span><span class="n">err</span><span class="p">));</span>
<span class="w">        </span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<p>集群句柄配置好后，就可以用 <a class="reference internal" href="#c.rados_connect" title="rados_connect"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_connect()</span></code></a> 连接了：</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rados_connect</span><span class="p">(</span><span class="n">cluster</span><span class="p">);</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;%s: cannot connect to cluster: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="w"> </span><span class="n">strerror</span><span class="p">(</span><span class="o">-</span><span class="n">err</span><span class="p">));</span>
<span class="w">        </span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<p>然后打开一个“ IO 上下文”，用 <a class="reference internal" href="#c.rados_ioctx_create" title="rados_ioctx_create"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_ioctx_create()</span></code></a> 打开<a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><code class="xref c c-type docutils literal notranslate"><span class="pre">rados_ioctx_t</span></code></a> ：</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">rados_ioctx_t</span><span class="w"> </span><span class="n">io</span><span class="p">;</span>
<span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">poolname</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;mypool&quot;</span><span class="p">;</span>

<span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rados_ioctx_create</span><span class="p">(</span><span class="n">cluster</span><span class="p">,</span><span class="w"> </span><span class="n">poolname</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">io</span><span class="p">);</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;%s: cannot open rados pool %s: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="w"> </span><span class="n">poolname</span><span class="p">,</span><span class="w"> </span><span class="n">strerror</span><span class="p">(</span><span class="o">-</span><span class="n">err</span><span class="p">));</span>
<span class="w">        </span><span class="n">rados_shutdown</span><span class="p">(</span><span class="n">cluster</span><span class="p">);</span>
<span class="w">        </span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<p>注意，你访问的存储池必须存在。</p>
<p>这时你能用 RADOS 数据修改函数了，例如用 <a class="reference internal" href="#c.rados_write_full" title="rados_write_full"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_write_full()</span></code></a> 写入名为 <code class="docutils literal notranslate"><span class="pre">greeting</span></code> 的对象：</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rados_write_full</span><span class="p">(</span><span class="n">io</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;greeting&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;hello&quot;</span><span class="p">,</span><span class="w"> </span><span class="mi">5</span><span class="p">);</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;%s: cannot write pool %s: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="w"> </span><span class="n">poolname</span><span class="p">,</span><span class="w"> </span><span class="n">strerror</span><span class="p">(</span><span class="o">-</span><span class="n">err</span><span class="p">));</span>
<span class="w">        </span><span class="n">rados_ioctx_destroy</span><span class="p">(</span><span class="n">io</span><span class="p">);</span>
<span class="w">        </span><span class="n">rados_shutdown</span><span class="p">(</span><span class="n">cluster</span><span class="p">);</span>
<span class="w">        </span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<p>最后，用 <a class="reference internal" href="#c.rados_ioctx_destroy" title="rados_ioctx_destroy"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_ioctx_destroy()</span></code></a> 和 <a class="reference internal" href="#c.rados_shutdown" title="rados_shutdown"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_shutdown()</span></code></a> 分别关闭 IO 上下文、到 RADOS 的连接：</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">rados_ioctx_destroy</span><span class="p">(</span><span class="n">io</span><span class="p">);</span>
<span class="n">rados_shutdown</span><span class="p">(</span><span class="n">cluster</span><span class="p">);</span>
</pre></div>
</div>
</section>
<section id="io">
<h2>异步 IO<a class="headerlink" href="#io" title="Permalink to this heading"></a></h2>
<p>处理大量 IO 时，通常不必等一个完成再开始下一个。 <cite>Librados</cite> 提供了几种操作的异步版本：</p>
<ul class="simple">
<li><p><a class="reference internal" href="#c.rados_aio_write" title="rados_aio_write"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_aio_write()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.rados_aio_append" title="rados_aio_append"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_aio_append()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.rados_aio_write_full" title="rados_aio_write_full"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_aio_write_full()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.rados_aio_read" title="rados_aio_read"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_aio_read()</span></code></a></p></li>
</ul>
<p>对每种操作，都必须先创建一个 <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><code class="xref c c-type docutils literal notranslate"><span class="pre">rados_completion_t</span></code></a>
数据结构来表达做什么、何时安全或显式地调用 <a class="reference internal" href="#c.rados_aio_create_completion" title="rados_aio_create_completion"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_aio_create_completion()</span></code></a> 来结束，
如果没什么特殊需求，可以仅传递 NULL ：</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">rados_completion_t</span><span class="w"> </span><span class="n">comp</span><span class="p">;</span>
<span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rados_aio_create_completion</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">comp</span><span class="p">);</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;%s: could not create aio completion: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="w"> </span><span class="n">strerror</span><span class="p">(</span><span class="o">-</span><span class="n">err</span><span class="p">));</span>
<span class="w">        </span><span class="n">rados_ioctx_destroy</span><span class="p">(</span><span class="n">io</span><span class="p">);</span>
<span class="w">        </span><span class="n">rados_shutdown</span><span class="p">(</span><span class="n">cluster</span><span class="p">);</span>
<span class="w">        </span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<p>现在你可以调用任意一种异步 IO 操作了，然后等它出现在内存、
所有复制所在的硬盘里：</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rados_aio_write</span><span class="p">(</span><span class="n">io</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;foo&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">comp</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;bar&quot;</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;%s: could not schedule aio write: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="w"> </span><span class="n">strerror</span><span class="p">(</span><span class="o">-</span><span class="n">err</span><span class="p">));</span>
<span class="w">        </span><span class="n">rados_aio_release</span><span class="p">(</span><span class="n">comp</span><span class="p">);</span>
<span class="w">        </span><span class="n">rados_ioctx_destroy</span><span class="p">(</span><span class="n">io</span><span class="p">);</span>
<span class="w">        </span><span class="n">rados_shutdown</span><span class="p">(</span><span class="n">cluster</span><span class="p">);</span>
<span class="w">        </span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<span class="p">}</span>
<span class="n">rados_aio_wait_for_complete</span><span class="p">(</span><span class="n">comp</span><span class="p">);</span><span class="w"> </span><span class="c1">// in memory</span>
<span class="n">rados_aio_wait_for_safe</span><span class="p">(</span><span class="n">comp</span><span class="p">);</span><span class="w"> </span><span class="c1">// on disk</span>
</pre></div>
</div>
<p>最后，用 <a class="reference internal" href="#c.rados_aio_release" title="rados_aio_release"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_aio_release()</span></code></a> 释放内存：</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">rados_aio_release</span><span class="p">(</span><span class="n">comp</span><span class="p">);</span>
</pre></div>
</div>
<p>你可以用各种回叫函数告知应用程序何时可以持续写入、
或何时读缓冲是满的。例如，
如果你追加几个对象时想衡量每个操作的延时，
可以调度几个写操作、并把确认和提交时间保存到相应回叫函数，
然后用 <a class="reference internal" href="#c.rados_aio_flush" title="rados_aio_flush"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_aio_flush()</span></code></a> 等它们完成，
然后就可以分析延时了：</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">typedef</span><span class="w"> </span><span class="k">struct</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="k">struct</span><span class="w"> </span><span class="nc">timeval</span><span class="w"> </span><span class="n">start</span><span class="p">;</span>
<span class="w">        </span><span class="k">struct</span><span class="w"> </span><span class="nc">timeval</span><span class="w"> </span><span class="n">ack_end</span><span class="p">;</span>
<span class="w">        </span><span class="k">struct</span><span class="w"> </span><span class="nc">timeval</span><span class="w"> </span><span class="n">commit_end</span><span class="p">;</span>
<span class="p">}</span><span class="w"> </span><span class="n">req_duration</span><span class="p">;</span>

<span class="kt">void</span><span class="w"> </span><span class="nf">ack_callback</span><span class="p">(</span><span class="n">rados_completion_t</span><span class="w"> </span><span class="n">comp</span><span class="p">,</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="n">arg</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">req_duration</span><span class="w"> </span><span class="o">*</span><span class="n">dur</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">req_duration</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="n">arg</span><span class="p">;</span>
<span class="w">        </span><span class="n">gettimeofday</span><span class="p">(</span><span class="o">&amp;</span><span class="n">dur</span><span class="o">-&gt;</span><span class="n">ack_end</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span>
<span class="p">}</span>

<span class="kt">void</span><span class="w"> </span><span class="nf">commit_callback</span><span class="p">(</span><span class="n">rados_completion_t</span><span class="w"> </span><span class="n">comp</span><span class="p">,</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="n">arg</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">req_duration</span><span class="w"> </span><span class="o">*</span><span class="n">dur</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">req_duration</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="n">arg</span><span class="p">;</span>
<span class="w">        </span><span class="n">gettimeofday</span><span class="p">(</span><span class="o">&amp;</span><span class="n">dur</span><span class="o">-&gt;</span><span class="n">commit_end</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span>
<span class="p">}</span>

<span class="kt">int</span><span class="w"> </span><span class="nf">output_append_latency</span><span class="p">(</span><span class="n">rados_ioctx_t</span><span class="w"> </span><span class="n">io</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">data</span><span class="p">,</span><span class="w"> </span><span class="kt">size_t</span><span class="w"> </span><span class="n">len</span><span class="p">,</span><span class="w"> </span><span class="kt">size_t</span><span class="w"> </span><span class="n">num_writes</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">req_duration</span><span class="w"> </span><span class="n">times</span><span class="p">[</span><span class="n">num_writes</span><span class="p">];</span>
<span class="w">        </span><span class="n">rados_completion_t</span><span class="w"> </span><span class="n">comps</span><span class="p">[</span><span class="n">num_writes</span><span class="p">];</span>
<span class="w">        </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">size_t</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">num_writes</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">                </span><span class="n">gettimeofday</span><span class="p">(</span><span class="o">&amp;</span><span class="n">times</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">start</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span>
<span class="w">                </span><span class="kt">int</span><span class="w"> </span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rados_aio_create_completion</span><span class="p">((</span><span class="kt">void</span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="o">&amp;</span><span class="n">times</span><span class="p">[</span><span class="n">i</span><span class="p">],</span><span class="w"> </span><span class="n">ack_callback</span><span class="p">,</span><span class="w"> </span><span class="n">commit_callback</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">comps</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
<span class="w">                </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">                        </span><span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;Error creating rados completion: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">strerror</span><span class="p">(</span><span class="o">-</span><span class="n">err</span><span class="p">));</span>
<span class="w">                        </span><span class="k">return</span><span class="w"> </span><span class="n">err</span><span class="p">;</span>
<span class="w">                </span><span class="p">}</span>
<span class="w">                </span><span class="kt">char</span><span class="w"> </span><span class="n">obj_name</span><span class="p">[</span><span class="mi">100</span><span class="p">];</span>
<span class="w">                </span><span class="n">snprintf</span><span class="p">(</span><span class="n">obj_name</span><span class="p">,</span><span class="w"> </span><span class="k">sizeof</span><span class="p">(</span><span class="n">obj_name</span><span class="p">),</span><span class="w"> </span><span class="s">&quot;foo%ld&quot;</span><span class="p">,</span><span class="w"> </span><span class="p">(</span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">long</span><span class="p">)</span><span class="n">i</span><span class="p">);</span>
<span class="w">                </span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rados_aio_append</span><span class="p">(</span><span class="n">io</span><span class="p">,</span><span class="w"> </span><span class="n">obj_name</span><span class="p">,</span><span class="w"> </span><span class="n">comps</span><span class="p">[</span><span class="n">i</span><span class="p">],</span><span class="w"> </span><span class="n">data</span><span class="p">,</span><span class="w"> </span><span class="n">len</span><span class="p">);</span>
<span class="w">                </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">                        </span><span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;Error from rados_aio_append: %s&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">strerror</span><span class="p">(</span><span class="o">-</span><span class="n">err</span><span class="p">));</span>
<span class="w">                        </span><span class="k">return</span><span class="w"> </span><span class="n">err</span><span class="p">;</span>
<span class="w">                </span><span class="p">}</span>
<span class="w">        </span><span class="p">}</span>
<span class="w">        </span><span class="c1">// wait until all requests finish *and* the callbacks complete</span>
<span class="w">        </span><span class="n">rados_aio_flush</span><span class="p">(</span><span class="n">io</span><span class="p">);</span>
<span class="w">        </span><span class="c1">// the latencies can now be analyzed</span>
<span class="w">        </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Request # | Ack latency (s) | Commit latency (s)</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="w">        </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">size_t</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">num_writes</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">                </span><span class="c1">// don&#39;t forget to free the completions</span>
<span class="w">                </span><span class="n">rados_aio_release</span><span class="p">(</span><span class="n">comps</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
<span class="w">                </span><span class="k">struct</span><span class="w"> </span><span class="nc">timeval</span><span class="w"> </span><span class="n">ack_lat</span><span class="p">,</span><span class="w"> </span><span class="n">commit_lat</span><span class="p">;</span>
<span class="w">                </span><span class="n">timersub</span><span class="p">(</span><span class="o">&amp;</span><span class="n">times</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">ack_end</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">times</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">start</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">ack_lat</span><span class="p">);</span>
<span class="w">                </span><span class="n">timersub</span><span class="p">(</span><span class="o">&amp;</span><span class="n">times</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">commit_end</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">times</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">start</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">commit_lat</span><span class="p">);</span>
<span class="w">                </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;%9ld | %8ld.%06ld | %10ld.%06ld</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="p">(</span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">long</span><span class="p">)</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="n">ack_lat</span><span class="p">.</span><span class="n">tv_sec</span><span class="p">,</span><span class="w"> </span><span class="n">ack_lat</span><span class="p">.</span><span class="n">tv_usec</span><span class="p">,</span><span class="w"> </span><span class="n">commit_lat</span><span class="p">.</span><span class="n">tv_sec</span><span class="p">,</span><span class="w"> </span><span class="n">commit_lat</span><span class="p">.</span><span class="n">tv_usec</span><span class="p">);</span>
<span class="w">        </span><span class="p">}</span>
<span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>注意，所有 <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><code class="xref c c-type docutils literal notranslate"><span class="pre">rados_completion_t</span></code></a> 都必须用 <a class="reference internal" href="#c.rados_aio_release" title="rados_aio_release"><code class="xref c c-func docutils literal notranslate"><span class="pre">rados_aio_release()</span></code></a> 释放内存，以免造成内存泄漏。</p>
</section>
<section id="api">
<h2>API 调用<a class="headerlink" href="#api" title="Permalink to this heading"></a></h2>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-defines">Defines</p>
<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_ALL_NSPACES">
<span class="target" id="rados__types_8h_1a856cbae08b44becba45c76f5da40ffa2"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_ALL_NSPACES</span></span></span><a class="headerlink" href="#c.LIBRADOS_ALL_NSPACES" title="Permalink to this definition"></a><br /></dt>
<dd><p>Pass as nspace argument to rados_ioctx_set_namespace() before calling rados_nobjects_list_open() to return all objects in all namespaces. </p>
</dd></dl>

</div>
<dl class="c struct">
<dt class="sig sig-object c" id="c.obj_watch_t">
<span class="target" id="structobj__watch__t"></span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">obj_watch_t</span></span></span><a class="headerlink" href="#c.obj_watch_t" title="Permalink to this definition"></a><br /></dt>
<dd><div class="docutils container">
<em>#include &lt;rados_types.h&gt;</em></div>
<p>One item from list_watchers </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c" id="c.obj_watch_t.addr">
<span class="target" id="structobj__watch__t_1a5c521d5238d99ce7014905779cc3a2be"></span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">addr</span></span></span><span class="p"><span class="pre">[</span></span><span class="m"><span class="pre">256</span></span><span class="p"><span class="pre">]</span></span><a class="headerlink" href="#c.obj_watch_t.addr" title="Permalink to this definition"></a><br /></dt>
<dd><p>Address of the Watcher. </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.obj_watch_t.watcher_id">
<span class="target" id="structobj__watch__t_1a9b773ca6095b61ee6154107d59939a50"></span><span class="n"><span class="pre">int64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">watcher_id</span></span></span><a class="headerlink" href="#c.obj_watch_t.watcher_id" title="Permalink to this definition"></a><br /></dt>
<dd><p>Watcher ID. </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.obj_watch_t.cookie">
<span class="target" id="structobj__watch__t_1a6c49bc31779a8d2511838a5e0cb5ff31"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">cookie</span></span></span><a class="headerlink" href="#c.obj_watch_t.cookie" title="Permalink to this definition"></a><br /></dt>
<dd><p>Cookie. </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.obj_watch_t.timeout_seconds">
<span class="target" id="structobj__watch__t_1a5e987bcbc17814f83d559920f5aab1dd"></span><span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">timeout_seconds</span></span></span><a class="headerlink" href="#c.obj_watch_t.timeout_seconds" title="Permalink to this definition"></a><br /></dt>
<dd><p>Timeout in Seconds. </p>
</dd></dl>

</div>
</dd></dl>

<dl class="c struct">
<dt class="sig sig-object c" id="c.notify_ack_t">
<span class="target" id="structnotify__ack__t"></span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">notify_ack_t</span></span></span><a class="headerlink" href="#c.notify_ack_t" title="Permalink to this definition"></a><br /></dt>
<dd><div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c" id="c.notify_ack_t.notifier_id">
<span class="target" id="structnotify__ack__t_1aa23b42bae9d3f84bebc0932bb15a2fe9"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">notifier_id</span></span></span><a class="headerlink" href="#c.notify_ack_t.notifier_id" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.notify_ack_t.cookie">
<span class="target" id="structnotify__ack__t_1a469763474ba0010bc4d39e38086447d2"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">cookie</span></span></span><a class="headerlink" href="#c.notify_ack_t.cookie" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.notify_ack_t.payload">
<span class="target" id="structnotify__ack__t_1a47976f3c2e253616b83e69813d095f72"></span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">payload</span></span></span><a class="headerlink" href="#c.notify_ack_t.payload" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.notify_ack_t.payload_len">
<span class="target" id="structnotify__ack__t_1a291218985121bca811a97223d4bdb265"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">payload_len</span></span></span><a class="headerlink" href="#c.notify_ack_t.payload_len" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="c struct">
<dt class="sig sig-object c" id="c.notify_timeout_t">
<span class="target" id="structnotify__timeout__t"></span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">notify_timeout_t</span></span></span><a class="headerlink" href="#c.notify_timeout_t" title="Permalink to this definition"></a><br /></dt>
<dd><div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c" id="c.notify_timeout_t.notifier_id">
<span class="target" id="structnotify__timeout__t_1add9731c2fe018403fa3ebe4e6852271a"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">notifier_id</span></span></span><a class="headerlink" href="#c.notify_timeout_t.notifier_id" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.notify_timeout_t.cookie">
<span class="target" id="structnotify__timeout__t_1ae8113dfb006c8f0bf676046d198ad365"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">cookie</span></span></span><a class="headerlink" href="#c.notify_timeout_t.cookie" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

</div>
</dd></dl>

<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-xattr-comparison-operations">xattr comparison operations</p>
<p>Operators for comparing xattrs on objects, and aborting the rados_read_op or rados_write_op transaction if the comparison fails. </p>
<dl class="c enum">
<dt class="sig sig-object c">
<span class="target" id="librados_8h_1a822ecfb1fe34e807e9bf1d9dc9de5820"></span><span class="sig-name descname"></span></dt>
<dd><p><em>Values:</em></p>
<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_EQ">
<span class="target" id="librados_8h_1a822ecfb1fe34e807e9bf1d9dc9de5820a5704c5de1214a67ec3e9583548ee6445"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_CMPXATTR_OP_EQ</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_EQ" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_NE">
<span class="target" id="librados_8h_1a822ecfb1fe34e807e9bf1d9dc9de5820ac83502a6846342c73e08b21ed3b14000"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_CMPXATTR_OP_NE</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_NE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_GT">
<span class="target" id="librados_8h_1a822ecfb1fe34e807e9bf1d9dc9de5820a7dc00fff37f306f8607ba276efccee5c"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_CMPXATTR_OP_GT</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_GT" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_GTE">
<span class="target" id="librados_8h_1a822ecfb1fe34e807e9bf1d9dc9de5820a5a26abc77163a561d7bf619803c571c8"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_CMPXATTR_OP_GTE</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_GTE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_LT">
<span class="target" id="librados_8h_1a822ecfb1fe34e807e9bf1d9dc9de5820abfdc72e29e7cbad7e278d5bbaf2a33bf"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_CMPXATTR_OP_LT</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_LT" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_LTE">
<span class="target" id="librados_8h_1a822ecfb1fe34e807e9bf1d9dc9de5820ac5321f346c6a7022b0b3b42b83db72ee"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_CMPXATTR_OP_LTE</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_CMPXATTR_OP_LTE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-operation-flags">Operation Flags</p>
<p>Flags for rados_read_op_operate(), rados_write_op_operate(), rados_aio_read_op_operate(), and rados_aio_write_op_operate(). See librados.hpp for details. </p>
<dl class="c enum">
<dt class="sig sig-object c">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0b"></span><span class="sig-name descname"></span></dt>
<dd><p><em>Values:</em></p>
<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_NOFLAG">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0bad7f7f30ddb552d642d73a687a8bef0d8"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_NOFLAG</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_NOFLAG" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_BALANCE_READS">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0ba497824d4474d47b623efbc0e196c453c"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_BALANCE_READS</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_BALANCE_READS" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_LOCALIZE_READS">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0ba542458b2695c3dd9a9e670dd85604ff9"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_LOCALIZE_READS</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_LOCALIZE_READS" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_ORDER_READS_WRITES">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0bab107ef49cec1bcf177e55128308ade3e"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_ORDER_READS_WRITES</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_ORDER_READS_WRITES" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_IGNORE_CACHE">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0bafb3e7bac2e9fb9b9c54a7ed24750539d"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_IGNORE_CACHE</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_IGNORE_CACHE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_SKIPRWLOCKS">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0ba7c30ed12a974a3082476aaac4528b7e5"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_SKIPRWLOCKS</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_SKIPRWLOCKS" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_IGNORE_OVERLAY">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0bafab8b9d5a183456a775969623b452206"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_IGNORE_OVERLAY</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_IGNORE_OVERLAY" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_FULL_TRY">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0bab563d85c24ddc59decad4f6dc15bd1a0"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_FULL_TRY</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_FULL_TRY" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_FULL_FORCE">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0ba59cf7ffa6d11abbb38ee4b7b1651ebb8"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_FULL_FORCE</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_FULL_FORCE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_IGNORE_REDIRECT">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0bae84c8e3954164c76a36c10a665b325e5"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_IGNORE_REDIRECT</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_IGNORE_REDIRECT" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_ORDERSNAP">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0ba1ecb4c119bd78a9ae5d24c27a26ba04c"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_ORDERSNAP</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_ORDERSNAP" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OPERATION_RETURNVEC">
<span class="target" id="librados_8h_1a82e50883a951e2f0207a4df9b1c37c0baa70d0f253cbc16c381d826fe9b5662a4"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OPERATION_RETURNVEC</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OPERATION_RETURNVEC" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-alloc-hint-flags">Alloc hint flags</p>
<p>Flags for rados_write_op_alloc_hint2() and rados_set_alloc_hint2() indicating future IO patterns. </p>
<dl class="c enum">
<dt class="sig sig-object c">
<span class="target" id="librados_8h_1aaa9719802566a181a3300a0bfafd5e2c"></span><span class="sig-name descname"></span></dt>
<dd><p><em>Values:</em></p>
<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_SEQUENTIAL_WRITE">
<span class="target" id="librados_8h_1aaa9719802566a181a3300a0bfafd5e2ca84edfc171cb9930894729821ddb46edd"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_ALLOC_HINT_FLAG_SEQUENTIAL_WRITE</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_SEQUENTIAL_WRITE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_RANDOM_WRITE">
<span class="target" id="librados_8h_1aaa9719802566a181a3300a0bfafd5e2cae76cd323ff2e928df6119d42d59d28fe"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_ALLOC_HINT_FLAG_RANDOM_WRITE</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_RANDOM_WRITE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_SEQUENTIAL_READ">
<span class="target" id="librados_8h_1aaa9719802566a181a3300a0bfafd5e2ca286c94e77baf5220271a4a259b0db4b3"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_ALLOC_HINT_FLAG_SEQUENTIAL_READ</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_SEQUENTIAL_READ" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_RANDOM_READ">
<span class="target" id="librados_8h_1aaa9719802566a181a3300a0bfafd5e2ca44efcee9a5a7b6b05e26470173acf195"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_ALLOC_HINT_FLAG_RANDOM_READ</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_RANDOM_READ" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_APPEND_ONLY">
<span class="target" id="librados_8h_1aaa9719802566a181a3300a0bfafd5e2cab31540f6184e0f8f24531eb6f06c94a5"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_ALLOC_HINT_FLAG_APPEND_ONLY</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_APPEND_ONLY" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_IMMUTABLE">
<span class="target" id="librados_8h_1aaa9719802566a181a3300a0bfafd5e2ca06295da1eca7a3dedf093a82709e17f9"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_ALLOC_HINT_FLAG_IMMUTABLE</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_IMMUTABLE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_SHORTLIVED">
<span class="target" id="librados_8h_1aaa9719802566a181a3300a0bfafd5e2ca93d85b03a9209347ebbfc94bc4888465"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_ALLOC_HINT_FLAG_SHORTLIVED</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_SHORTLIVED" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_LONGLIVED">
<span class="target" id="librados_8h_1aaa9719802566a181a3300a0bfafd5e2ca40322b698c38af5fe15ebf5094597ff4"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_ALLOC_HINT_FLAG_LONGLIVED</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_LONGLIVED" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_COMPRESSIBLE">
<span class="target" id="librados_8h_1aaa9719802566a181a3300a0bfafd5e2ca6329e9f57cfb196672c366955ff26452"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_ALLOC_HINT_FLAG_COMPRESSIBLE</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_COMPRESSIBLE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_INCOMPRESSIBLE">
<span class="target" id="librados_8h_1aaa9719802566a181a3300a0bfafd5e2cab5aad30114c83da7c50114a58af33cd4"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_ALLOC_HINT_FLAG_INCOMPRESSIBLE</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_ALLOC_HINT_FLAG_INCOMPRESSIBLE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-asynchronous-i/o">Asynchronous I/O</p>
<p>Read and write to objects without blocking. </p>
<dl class="c type">
<dt class="sig sig-object c" id="c.rados_callback_t">
<span class="target" id="librados_8h_1a71d5f44643f35270ad1e9e95e4327ebf"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_callback_t</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cb</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="p"><span class="pre">)</span></span><a class="headerlink" href="#c.rados_callback_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>Callbacks for asynchrous operations take two parameters:<ul class="simple">
<li><p>cb the completion that has finished</p></li>
<li><p>arg application defined data made available to the callback function </p></li>
</ul>
</p>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_create_completion">
<span class="target" id="librados_8h_1a82bd92248d366235784c324b74d03a08"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_create_completion</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cb_arg</span></span>, <a class="reference internal" href="#c.rados_callback_t" title="rados_callback_t"><span class="n"><span class="pre">rados_callback_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cb_complete</span></span>, <a class="reference internal" href="#c.rados_callback_t" title="rados_callback_t"><span class="n"><span class="pre">rados_callback_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cb_safe</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pc</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_create_completion" title="Permalink to this definition"></a><br /></dt>
<dd><p>Constructs a completion to use with asynchronous operations</p>
<p>The complete and safe callbacks correspond to operations being acked and committed, respectively. The callbacks are called in order of receipt, so the safe callback may be triggered before the complete callback, and vice versa. This is affected by journalling on the OSDs.</p>
<p>TODO: more complete documentation of this elsewhere (in the RADOS docs?)</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Read operations only get a complete callback. </p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: this should check for ENOMEM instead of throwing an exception</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cb_arg</strong> -- application-defined data passed to the callback functions </p></li>
<li><p><strong>cb_complete</strong> -- the function to be called when the operation is in memory on all replicas </p></li>
<li><p><strong>cb_safe</strong> -- the function to be called when the operation is on stable storage on all replicas </p></li>
<li><p><strong>pc</strong> -- where to store the completion </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_create_completion2">
<span class="target" id="librados_8h_1ab332cd2f988a743e8827c6e9576b8b80"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_create_completion2</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cb_arg</span></span>, <a class="reference internal" href="#c.rados_callback_t" title="rados_callback_t"><span class="n"><span class="pre">rados_callback_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cb_complete</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pc</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_create_completion2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Constructs a completion to use with asynchronous operations</p>
<p>The complete callback corresponds to operation being acked.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: this should check for ENOMEM instead of throwing an exception</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cb_arg</strong> -- application-defined data passed to the callback functions </p></li>
<li><p><strong>cb_complete</strong> -- the function to be called when the operation is committed on all replicas </p></li>
<li><p><strong>pc</strong> -- where to store the completion </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_wait_for_complete">
<span class="target" id="librados_8h_1aae86e03af1619868c407bffb7e0e223d"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_wait_for_complete</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_wait_for_complete" title="Permalink to this definition"></a><br /></dt>
<dd><p>Block until an operation completes</p>
<p>This means it is in memory on all replicas.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: this should be void</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>c</strong> -- operation to wait for </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_wait_for_safe">
<span class="target" id="librados_8h_1aa3b8e27ef0f05cb1771a75cb3848ec5d"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_wait_for_safe</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">c</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_aio_wait_for_safe" title="Permalink to this definition"></a><br /></dt>
<dd><p>Block until an operation is safe</p>
<p>This means it is on stable storage on all replicas.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: this should be void</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>c</strong> -- operation to wait for </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_is_complete">
<span class="target" id="librados_8h_1a122102e047b7c8f2cb15605847708098"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_is_complete</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_is_complete" title="Permalink to this definition"></a><br /></dt>
<dd><p>Has an asynchronous operation completed?</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This does not imply that the complete callback has finished</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>c</strong> -- async operation to inspect </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>whether c is complete </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_is_safe">
<span class="target" id="librados_8h_1a59a3083b3aa48aa576bbf1fcaab1f7f8"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_is_safe</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_is_safe" title="Permalink to this definition"></a><br /></dt>
<dd><p>Is an asynchronous operation safe?</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This does not imply that the safe callback has finished</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>c</strong> -- async operation to inspect </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>whether c is safe </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_wait_for_complete_and_cb">
<span class="target" id="librados_8h_1aa6759f83759833fe3126dea3276e2454"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_wait_for_complete_and_cb</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_wait_for_complete_and_cb" title="Permalink to this definition"></a><br /></dt>
<dd><p>Block until an operation completes and callback completes</p>
<p>This means it is in memory on all replicas and can be read.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: this should be void</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>c</strong> -- operation to wait for </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_wait_for_safe_and_cb">
<span class="target" id="librados_8h_1aab326cf7f9867e8a31adcb4cedb84823"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_wait_for_safe_and_cb</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">c</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_aio_wait_for_safe_and_cb" title="Permalink to this definition"></a><br /></dt>
<dd><p>Block until an operation is safe and callback has completed</p>
<p>This means it is on stable storage on all replicas.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: this should be void</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>c</strong> -- operation to wait for </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_is_complete_and_cb">
<span class="target" id="librados_8h_1aa9505c01eb2e7391ef14fea41b5afb0f"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_is_complete_and_cb</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_is_complete_and_cb" title="Permalink to this definition"></a><br /></dt>
<dd><p>Has an asynchronous operation and callback completed</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>c</strong> -- async operation to inspect </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>whether c is complete </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_is_safe_and_cb">
<span class="target" id="librados_8h_1a267d9341f6bda3cbe0f5a96d9a901602"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_is_safe_and_cb</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_is_safe_and_cb" title="Permalink to this definition"></a><br /></dt>
<dd><p>Is an asynchronous operation safe and has the callback completed</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>c</strong> -- async operation to inspect </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>whether c is safe </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_get_return_value">
<span class="target" id="librados_8h_1acaa10533847a7fc1c46d348dfe2dfec5"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_get_return_value</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_get_return_value" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the return value of an asychronous operation</p>
<p>The return value is set when the operation is complete or safe, whichever comes first.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: complete callback may never be called when the safe message is received before the complete message</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>c</strong> -- async operation to inspect </p></li>
</ul>
</dd>
<dt class="field-even">Pre<span class="colon">:</span></dt>
<dd class="field-even"><p>The operation is safe or complete</p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>return value of the operation </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_get_version">
<span class="target" id="librados_8h_1a764c6cdf2327c31881c05b4ee203c0d8"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_get_version</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_get_version" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the internal object version of the target of an asychronous operation</p>
<p>The return value is set when the operation is complete or safe, whichever comes first.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: complete callback may never be called when the safe message is received before the complete message</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>c</strong> -- async operation to inspect </p></li>
</ul>
</dd>
<dt class="field-even">Pre<span class="colon">:</span></dt>
<dd class="field-even"><p>The operation is safe or complete</p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>version number of the asychronous operation’s target </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_release">
<span class="target" id="librados_8h_1afaffcbc8c31350450d4d4930fbb1d407"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_release</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_release" title="Permalink to this definition"></a><br /></dt>
<dd><p>Release a completion</p>
<p>Call this when you no longer need the completion. It may not be freed immediately if the operation is not acked and committed.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>c</strong> -- completion to release </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_write">
<span class="target" id="librados_8h_1a587ada4e957961c74a014ef8d96b749c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_write</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">off</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_write" title="Permalink to this definition"></a><br /></dt>
<dd><p>Write data to an object asynchronously</p>
<p>Queues the write and returns. The return value of the completion will be 0 on success, negative error code on failure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which the write will occur </p></li>
<li><p><strong>oid</strong> -- name of the object </p></li>
<li><p><strong>completion</strong> -- what to do when the write is safe and complete </p></li>
<li><p><strong>buf</strong> -- data to write </p></li>
<li><p><strong>len</strong> -- length of the data, in bytes </p></li>
<li><p><strong>off</strong> -- byte offset in the object to begin writing at </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, -EROFS if the io context specifies a snap_seq other than LIBRADOS_SNAP_HEAD </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_append">
<span class="target" id="librados_8h_1ad94a11d47df2eb928e2c3a8eed52f9e2"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_append</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_append" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously append data to an object</p>
<p>Queues the append and returns.</p>
<p>The return value of the completion will be 0 on success, negative error code on failure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context to operate in </p></li>
<li><p><strong>oid</strong> -- the name of the object </p></li>
<li><p><strong>completion</strong> -- what to do when the append is safe and complete </p></li>
<li><p><strong>buf</strong> -- the data to append </p></li>
<li><p><strong>len</strong> -- length of buf (in bytes) </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, -EROFS if the io context specifies a snap_seq other than LIBRADOS_SNAP_HEAD </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_write_full">
<span class="target" id="librados_8h_1a1030b548917ba660338cb12d9b6cf062"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_write_full</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_write_full" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously write an entire object</p>
<p>The object is filled with the provided data. If the object exists, it is atomically truncated and then written. Queues the write_full and returns.</p>
<p>The return value of the completion will be 0 on success, negative error code on failure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context in which the write will occur </p></li>
<li><p><strong>oid</strong> -- name of the object </p></li>
<li><p><strong>completion</strong> -- what to do when the write_full is safe and complete </p></li>
<li><p><strong>buf</strong> -- data to write </p></li>
<li><p><strong>len</strong> -- length of the data, in bytes </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, -EROFS if the io context specifies a snap_seq other than LIBRADOS_SNAP_HEAD </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_writesame">
<span class="target" id="librados_8h_1ab9b5e2a50d550c88a68ae4add03742bb"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_writesame</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">data_len</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">write_len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">off</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_writesame" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously write the same buffer multiple times</p>
<p>Queues the writesame and returns.</p>
<p>The return value of the completion will be 0 on success, negative error code on failure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context in which the write will occur </p></li>
<li><p><strong>oid</strong> -- name of the object </p></li>
<li><p><strong>completion</strong> -- what to do when the writesame is safe and complete </p></li>
<li><p><strong>buf</strong> -- data to write </p></li>
<li><p><strong>data_len</strong> -- length of the data, in bytes </p></li>
<li><p><strong>write_len</strong> -- the total number of bytes to write </p></li>
<li><p><strong>off</strong> -- byte offset in the object to begin writing at </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, -EROFS if the io context specifies a snap_seq other than LIBRADOS_SNAP_HEAD </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_remove">
<span class="target" id="librados_8h_1ac6d6219c67a9044ab7ce9027f1ca5c60"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_remove</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_remove" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously remove an object</p>
<p>Queues the remove and returns.</p>
<p>The return value of the completion will be 0 on success, negative error code on failure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context to operate in </p></li>
<li><p><strong>oid</strong> -- the name of the object </p></li>
<li><p><strong>completion</strong> -- what to do when the remove is safe and complete </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, -EROFS if the io context specifies a snap_seq other than LIBRADOS_SNAP_HEAD </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_read">
<span class="target" id="librados_8h_1a82af6f46e22d129c3492e000b8fddfe7"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_read</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">off</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_read" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously read data from an object</p>
<p>The io context determines the snapshot to read from, if any was set by rados_ioctx_snap_set_read().</p>
<p>The return value of the completion will be number of bytes read on success, negative error code on failure.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>only the ‘complete’ callback of the completion will be called.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to perform the read </p></li>
<li><p><strong>oid</strong> -- the name of the object to read from </p></li>
<li><p><strong>completion</strong> -- what to do when the read is complete </p></li>
<li><p><strong>buf</strong> -- where to store the results </p></li>
<li><p><strong>len</strong> -- the number of bytes to read </p></li>
<li><p><strong>off</strong> -- the offset to start reading from in the object </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_flush">
<span class="target" id="librados_8h_1abd71638b9c50bf12b583cf2e09020b57"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_flush</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_flush" title="Permalink to this definition"></a><br /></dt>
<dd><p>Block until all pending writes in an io context are safe</p>
<p>This is not equivalent to calling rados_aio_wait_for_safe() on all write completions, since this waits for the associated callbacks to complete as well.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: always returns 0, should be void or accept a timeout</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context to flush </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_flush_async">
<span class="target" id="librados_8h_1a27d3f341f811db793d878b4aad5c848e"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_flush_async</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_flush_async" title="Permalink to this definition"></a><br /></dt>
<dd><p>Schedule a callback for when all currently pending aio writes are safe. This is a non-blocking version of rados_aio_flush().</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context to flush </p></li>
<li><p><strong>completion</strong> -- what to do when the writes are safe </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_stat">
<span class="target" id="librados_8h_1ac4267774917ed99390c685dbdd9d40fd"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_stat</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">psize</span></span>, <span class="n"><span class="pre">time_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pmtime</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_stat" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously get object stats (size/mtime)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- ioctx </p></li>
<li><p><strong>o</strong> -- object name </p></li>
<li><p><strong>completion</strong> -- what to do when the stat is complete </p></li>
<li><p><strong>psize</strong> -- where to store object size </p></li>
<li><p><strong>pmtime</strong> -- where to store modification time </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_stat2">
<span class="target" id="librados_8h_1aa73378b437be4f75c975c7bca8e620dd"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_stat2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">psize</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">timespec</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pmtime</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_stat2" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_cmpext">
<span class="target" id="librados_8h_1a4513c02f791db59b2f1479aec614ce63"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_cmpext</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cmp_buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">cmp_len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">off</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_cmpext" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously compare an on-disk object range with a buffer</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to perform the comparison </p></li>
<li><p><strong>o</strong> -- the name of the object to compare with </p></li>
<li><p><strong>completion</strong> -- what to do when the comparison is complete </p></li>
<li><p><strong>cmp_buf</strong> -- buffer containing bytes to be compared with object contents </p></li>
<li><p><strong>cmp_len</strong> -- length to compare and size of <code class="docutils literal notranslate"><span class="pre">cmp_buf</span></code> in bytes </p></li>
<li><p><strong>off</strong> -- object byte offset at which to start the comparison </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure, (-MAX_ERRNO - mismatch_off) on mismatch </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_cancel">
<span class="target" id="librados_8h_1a4067709a222491b20f700ccde2975f6c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_cancel</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_cancel" title="Permalink to this definition"></a><br /></dt>
<dd><p>Cancel async operation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- ioctx </p></li>
<li><p><strong>completion</strong> -- completion handle </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_exec">
<span class="target" id="librados_8h_1a0724e9302890a6263d4d9142c914b17e"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_exec</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cls</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">method</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">in_buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">in_len</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">out_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_exec" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously execute an OSD class method on an object</p>
<p>The OSD has a plugin mechanism for performing complicated operations on an object atomically. These plugins are called classes. This function allows librados users to call the custom methods. The input and output formats are defined by the class. Classes in ceph.git can be found in src/cls subdirectories</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to call the method </p></li>
<li><p><strong>o</strong> -- name of the object </p></li>
<li><p><strong>completion</strong> -- what to do when the exec completes </p></li>
<li><p><strong>cls</strong> -- the name of the class </p></li>
<li><p><strong>method</strong> -- the name of the method </p></li>
<li><p><strong>in_buf</strong> -- where to find input </p></li>
<li><p><strong>in_len</strong> -- length of in_buf in bytes </p></li>
<li><p><strong>buf</strong> -- where to store output </p></li>
<li><p><strong>out_len</strong> -- length of buf in bytes </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-watch/notify">Watch/Notify</p>
<p>Watch/notify is a protocol to help communicate among clients. It can be used to sychronize client state. All that’s needed is a well-known object name (for example, rbd uses the header object of an image).</p>
<p>Watchers register an interest in an object, and receive all notifies on that object. A notify attempts to communicate with all clients watching an object, and blocks on the notifier until each client responds or a timeout is reached.</p>
<p>See rados_watch() and rados_notify() for more details. </p>
<dl class="c type">
<dt class="sig sig-object c" id="c.rados_watchcb_t">
<span class="target" id="librados_8h_1aa11c75c330c070493c66081fdc2ba20a"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_watchcb_t</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">opcode</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">ver</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="p"><span class="pre">)</span></span><a class="headerlink" href="#c.rados_watchcb_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>Callback activated when a notify is received on a watched object.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: opcode is an internal detail that shouldn’t be exposed </p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: ver is unused </p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Param opcode<span class="colon">:</span></dt>
<dd class="field-odd"><p>undefined </p>
</dd>
<dt class="field-even">Param ver<span class="colon">:</span></dt>
<dd class="field-even"><p>version of the watched object </p>
</dd>
<dt class="field-odd">Param arg<span class="colon">:</span></dt>
<dd class="field-odd"><p>application-specific data</p>
</dd>
</dl>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_watchcb2_t">
<span class="target" id="librados_8h_1a389d9de29d3ced3fb3e694ee5d2db3df"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_watchcb2_t</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">notify_id</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">handle</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">notifier_id</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">data_len</span></span><span class="p"><span class="pre">)</span></span><a class="headerlink" href="#c.rados_watchcb2_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>Callback activated when a notify is received on a watched object.</p>
<dl class="field-list simple">
<dt class="field-odd">Param arg<span class="colon">:</span></dt>
<dd class="field-odd"><p>opaque user-defined value provided to rados_watch2() </p>
</dd>
<dt class="field-even">Param notify_id<span class="colon">:</span></dt>
<dd class="field-even"><p>an id for this notify event </p>
</dd>
<dt class="field-odd">Param handle<span class="colon">:</span></dt>
<dd class="field-odd"><p>the watcher handle we are notifying </p>
</dd>
<dt class="field-even">Param notifier_id<span class="colon">:</span></dt>
<dd class="field-even"><p>the unique client id for the notifier </p>
</dd>
<dt class="field-odd">Param data<span class="colon">:</span></dt>
<dd class="field-odd"><p>payload from the notifier </p>
</dd>
<dt class="field-even">Param data_len<span class="colon">:</span></dt>
<dd class="field-even"><p>length of payload buffer </p>
</dd>
</dl>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_watcherrcb_t">
<span class="target" id="librados_8h_1a27efd48346f2f3905724c3c6a1aa85bc"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_watcherrcb_t</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pre</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">cookie</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">err</span></span><span class="p"><span class="pre">)</span></span><a class="headerlink" href="#c.rados_watcherrcb_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>Callback activated when we encounter an error with the watch session. This can happen when the location of the objects moves within the cluster and we fail to register our watch with the new object location, or when our connection with the object OSD is otherwise interrupted and we may have missed notify events.</p>
<dl class="field-list simple">
<dt class="field-odd">Param pre<span class="colon">:</span></dt>
<dd class="field-odd"><p>opaque user-defined value provided to rados_watch2() </p>
</dd>
<dt class="field-even">Param cookie<span class="colon">:</span></dt>
<dd class="field-even"><p>the internal id assigned to the watch session </p>
</dd>
<dt class="field-odd">Param err<span class="colon">:</span></dt>
<dd class="field-odd"><p>error code </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_watch">
<span class="target" id="librados_8h_1ab4b73dc26856c913f192a343e24dc1f6"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_watch</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">ver</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cookie</span></span>, <a class="reference internal" href="#c.rados_watchcb_t" title="rados_watchcb_t"><span class="n"><span class="pre">rados_watchcb_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">watchcb</span></span>, <span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_watch" title="Permalink to this definition"></a><br /></dt>
<dd><p>Register an interest in an object</p>
<p>A watch operation registers the client as being interested in notifications on an object. OSDs keep track of watches on persistent storage, so they are preserved across cluster changes by the normal recovery process. If the client loses its connection to the primary OSD for a watched object, the watch will be removed after 30 seconds. Watches are automatically reestablished when a new connection is made, or a placement group switches OSDs.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: librados should provide a way for watchers to notice connection resets </p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: the ver parameter does not work, and -ERANGE will never be returned (See URL tracker.ceph.com/issues/2592)</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the object to watch </p></li>
<li><p><strong>ver</strong> -- expected version of the object </p></li>
<li><p><strong>cookie</strong> -- where to store the internal id assigned to this watch </p></li>
<li><p><strong>watchcb</strong> -- what to do when a notify is received on this object </p></li>
<li><p><strong>arg</strong> -- application defined data to pass when watchcb is called </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ERANGE if the version of the object is greater than ver </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_watch2">
<span class="target" id="librados_8h_1ab9eb476c010992ecdb9b0e0512d400da"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_watch2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cookie</span></span>, <a class="reference internal" href="#c.rados_watchcb2_t" title="rados_watchcb2_t"><span class="n"><span class="pre">rados_watchcb2_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">watchcb</span></span>, <a class="reference internal" href="#c.rados_watcherrcb_t" title="rados_watcherrcb_t"><span class="n"><span class="pre">rados_watcherrcb_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">watcherrcb</span></span>, <span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_watch2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Register an interest in an object</p>
<p>A watch operation registers the client as being interested in notifications on an object. OSDs keep track of watches on persistent storage, so they are preserved across cluster changes by the normal recovery process. If the client loses its connection to the primary OSD for a watched object, the watch will be removed after a timeout configured with osd_client_watch_timeout. Watches are automatically reestablished when a new connection is made, or a placement group switches OSDs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the object to watch </p></li>
<li><p><strong>cookie</strong> -- where to store the internal id assigned to this watch </p></li>
<li><p><strong>watchcb</strong> -- what to do when a notify is received on this object </p></li>
<li><p><strong>watcherrcb</strong> -- what to do when the watch session encounters an error </p></li>
<li><p><strong>arg</strong> -- opaque value to pass to the callback </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_watch3">
<span class="target" id="librados_8h_1a0766a7b5337df893919d79579f576c6e"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_watch3</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cookie</span></span>, <a class="reference internal" href="#c.rados_watchcb2_t" title="rados_watchcb2_t"><span class="n"><span class="pre">rados_watchcb2_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">watchcb</span></span>, <a class="reference internal" href="#c.rados_watcherrcb_t" title="rados_watcherrcb_t"><span class="n"><span class="pre">rados_watcherrcb_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">watcherrcb</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">timeout</span></span>, <span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_watch3" title="Permalink to this definition"></a><br /></dt>
<dd><p>Register an interest in an object</p>
<p>A watch operation registers the client as being interested in notifications on an object. OSDs keep track of watches on persistent storage, so they are preserved across cluster changes by the normal recovery process. Watches are automatically reestablished when a new connection is made, or a placement group switches OSDs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the object to watch </p></li>
<li><p><strong>cookie</strong> -- where to store the internal id assigned to this watch </p></li>
<li><p><strong>watchcb</strong> -- what to do when a notify is received on this object </p></li>
<li><p><strong>watcherrcb</strong> -- what to do when the watch session encounters an error </p></li>
<li><p><strong>timeout</strong> -- how many seconds the connection will keep after disconnection </p></li>
<li><p><strong>arg</strong> -- opaque value to pass to the callback </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_watch">
<span class="target" id="librados_8h_1a88a56d96de61824e4d7e705dae8893ef"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_watch</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">handle</span></span>, <a class="reference internal" href="#c.rados_watchcb2_t" title="rados_watchcb2_t"><span class="n"><span class="pre">rados_watchcb2_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">watchcb</span></span>, <a class="reference internal" href="#c.rados_watcherrcb_t" title="rados_watcherrcb_t"><span class="n"><span class="pre">rados_watcherrcb_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">watcherrcb</span></span>, <span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_watch" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronous register an interest in an object</p>
<p>A watch operation registers the client as being interested in notifications on an object. OSDs keep track of watches on persistent storage, so they are preserved across cluster changes by the normal recovery process. If the client loses its connection to the primary OSD for a watched object, the watch will be removed after 30 seconds. Watches are automatically reestablished when a new connection is made, or a placement group switches OSDs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the object to watch </p></li>
<li><p><strong>completion</strong> -- what to do when operation has been attempted </p></li>
<li><p><strong>handle</strong> -- where to store the internal id assigned to this watch </p></li>
<li><p><strong>watchcb</strong> -- what to do when a notify is received on this object </p></li>
<li><p><strong>watcherrcb</strong> -- what to do when the watch session encounters an error </p></li>
<li><p><strong>arg</strong> -- opaque value to pass to the callback </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_watch2">
<span class="target" id="librados_8h_1aa97eb95a996cfc5271073b1928356715"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_watch2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">handle</span></span>, <a class="reference internal" href="#c.rados_watchcb2_t" title="rados_watchcb2_t"><span class="n"><span class="pre">rados_watchcb2_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">watchcb</span></span>, <a class="reference internal" href="#c.rados_watcherrcb_t" title="rados_watcherrcb_t"><span class="n"><span class="pre">rados_watcherrcb_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">watcherrcb</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">timeout</span></span>, <span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_watch2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronous register an interest in an object</p>
<p>A watch operation registers the client as being interested in notifications on an object. OSDs keep track of watches on persistent storage, so they are preserved across cluster changes by the normal recovery process. If the client loses its connection to the primary OSD for a watched object, the watch will be removed after the number of seconds that configured in timeout parameter. Watches are automatically reestablished when a new connection is made, or a placement group switches OSDs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the object to watch </p></li>
<li><p><strong>completion</strong> -- what to do when operation has been attempted </p></li>
<li><p><strong>handle</strong> -- where to store the internal id assigned to this watch </p></li>
<li><p><strong>watchcb</strong> -- what to do when a notify is received on this object </p></li>
<li><p><strong>watcherrcb</strong> -- what to do when the watch session encounters an error </p></li>
<li><p><strong>timeout</strong> -- how many seconds the connection will keep after disconnection </p></li>
<li><p><strong>arg</strong> -- opaque value to pass to the callback </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_watch_check">
<span class="target" id="librados_8h_1aad889771d147a8b3c6206ee5814c746c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_watch_check</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">cookie</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_watch_check" title="Permalink to this definition"></a><br /></dt>
<dd><p>Check on the status of a watch</p>
<p>Return the number of milliseconds since the watch was last confirmed. Or, if there has been an error, return that.</p>
<p>If there is an error, the watch is no longer valid, and should be destroyed with rados_unwatch2(). The the user is still interested in the object, a new watch should be created with rados_watch2().</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>cookie</strong> -- the watch handle </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>ms since last confirmed on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_unwatch">
<span class="target" id="librados_8h_1a34a2cec80163963cdcbf8d3716f527b1"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_unwatch</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">cookie</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_unwatch" title="Permalink to this definition"></a><br /></dt>
<dd><p>Unregister an interest in an object</p>
<p>Once this completes, no more notifies will be sent to us for this watch. This should be called to clean up unneeded watchers.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the name of the watched object (ignored) </p></li>
<li><p><strong>cookie</strong> -- which watch to unregister </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_unwatch2">
<span class="target" id="librados_8h_1a287eae9b09a92746411f4958cfa10009"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_unwatch2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">cookie</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_unwatch2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Unregister an interest in an object</p>
<p>Once this completes, no more notifies will be sent to us for this watch. This should be called to clean up unneeded watchers.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>cookie</strong> -- which watch to unregister </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_unwatch">
<span class="target" id="librados_8h_1abea4fb204b1e77aab0dcc3af5c68290b"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_unwatch</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">cookie</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_unwatch" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronous unregister an interest in an object</p>
<p>Once this completes, no more notifies will be sent to us for this watch. This should be called to clean up unneeded watchers.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>completion</strong> -- what to do when operation has been attempted </p></li>
<li><p><strong>cookie</strong> -- which watch to unregister </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_notify">
<span class="target" id="librados_8h_1afa182725694143f1511727a2247d22ec"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_notify</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">ver</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">buf_len</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_notify" title="Permalink to this definition"></a><br /></dt>
<dd><p>Sychronously notify watchers of an object</p>
<p>This blocks until all watchers of the object have received and reacted to the notify, or a timeout is reached.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: the timeout is not changeable via the C API </p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: the bufferlist is inaccessible in a rados_watchcb_t</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>ver</strong> -- obsolete - just pass zero </p></li>
<li><p><strong>buf</strong> -- data to send to watchers </p></li>
<li><p><strong>buf_len</strong> -- length of buf in bytes </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_notify">
<span class="target" id="librados_8h_1a1c9fe9371fcbba5fa81a4f975832fd2c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_notify</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">buf_len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">timeout_ms</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">reply_buffer</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">reply_buffer_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_notify" title="Permalink to this definition"></a><br /></dt>
<dd><p>Sychronously notify watchers of an object</p>
<p>This blocks until all watchers of the object have received and reacted to the notify, or a timeout is reached.</p>
<p>The reply buffer is optional. If specified, the client will get back an encoded buffer that includes the ids of the clients that acknowledged the notify as well as their notify ack payloads (if any). Clients that timed out are not included. Even clients that do not include a notify ack payload are included in the list but have a 0-length payload associated with them. The format:</p>
<p>le32 num_acks { le64 gid global id for the client (for client.1234 that’s 1234) le64 cookie cookie for the client le32 buflen length of reply message buffer u8 * buflen payload } * num_acks le32 num_timeouts { le64 gid global id for the client le64 cookie cookie for the client } * num_timeouts</p>
<p>Note: There may be multiple instances of the same gid if there are multiple watchers registered via the same client.</p>
<p>Note: The buffer must be released with rados_buffer_free() when the user is done with it.</p>
<p>Note: Since the result buffer includes clients that time out, it will be set even when rados_notify() returns an error code (like -ETIMEDOUT).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>completion</strong> -- what to do when operation has been attempted </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>buf</strong> -- data to send to watchers </p></li>
<li><p><strong>buf_len</strong> -- length of buf in bytes </p></li>
<li><p><strong>timeout_ms</strong> -- notify timeout (in ms) </p></li>
<li><p><strong>reply_buffer</strong> -- pointer to reply buffer pointer (free with rados_buffer_free) </p></li>
<li><p><strong>reply_buffer_len</strong> -- pointer to size of reply buffer </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_notify2">
<span class="target" id="librados_8h_1a293bb8250b58fc8026133ce6c8740fcb"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_notify2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">buf_len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">timeout_ms</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">reply_buffer</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">reply_buffer_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_notify2" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_decode_notify_response">
<span class="target" id="librados_8h_1a34f51e8452c85ea8ec3424725b745f87"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_decode_notify_response</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">reply_buffer</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">reply_buffer_len</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="#c.notify_ack_t" title="notify_ack_t"><span class="n"><span class="pre">notify_ack_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">acks</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">nr_acks</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="#c.notify_timeout_t" title="notify_timeout_t"><span class="n"><span class="pre">notify_timeout_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">timeouts</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">nr_timeouts</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_decode_notify_response" title="Permalink to this definition"></a><br /></dt>
<dd><p>Decode a notify response</p>
<p>Decode a notify response (from rados_aio_notify() call) into acks and timeout arrays.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>reply_buffer</strong> -- buffer from rados_aio_notify() call </p></li>
<li><p><strong>reply_buffer_len</strong> -- reply_buffer length </p></li>
<li><p><strong>acks</strong> -- pointer to struct <a class="reference internal" href="#structnotify__ack__t"><span class="std std-ref">notify_ack_t</span></a> pointer </p></li>
<li><p><strong>nr_acks</strong> -- pointer to ack count </p></li>
<li><p><strong>timeouts</strong> -- pointer to <a class="reference internal" href="#structnotify__timeout__t"><span class="std std-ref">notify_timeout_t</span></a> pointer </p></li>
<li><p><strong>nr_timeouts</strong> -- pointer to timeout count </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_free_notify_response">
<span class="target" id="librados_8h_1a9062859ffc2c616ee823d28d03207417"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_free_notify_response</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="#c.notify_ack_t" title="notify_ack_t"><span class="n"><span class="pre">notify_ack_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">acks</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">nr_acks</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="#c.notify_timeout_t" title="notify_timeout_t"><span class="n"><span class="pre">notify_timeout_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">timeouts</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_free_notify_response" title="Permalink to this definition"></a><br /></dt>
<dd><p>Free notify allocated buffer</p>
<p>Release memory allocated by rados_decode_notify_response() call</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>acks</strong> -- <a class="reference internal" href="#structnotify__ack__t"><span class="std std-ref">notify_ack_t</span></a> struct (from rados_decode_notify_response()) </p></li>
<li><p><strong>nr_acks</strong> -- ack count </p></li>
<li><p><strong>timeouts</strong> -- <a class="reference internal" href="#structnotify__timeout__t"><span class="std std-ref">notify_timeout_t</span></a> struct (from rados_decode_notify_response()) </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_notify_ack">
<span class="target" id="librados_8h_1af77609128f13ee04a3dce11d715611e2"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_notify_ack</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">notify_id</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">cookie</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">buf_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_notify_ack" title="Permalink to this definition"></a><br /></dt>
<dd><p>Acknolwedge receipt of a notify</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>notify_id</strong> -- the notify_id we got on the watchcb2_t callback </p></li>
<li><p><strong>cookie</strong> -- the watcher handle </p></li>
<li><p><strong>buf</strong> -- payload to return to notifier (optional) </p></li>
<li><p><strong>buf_len</strong> -- payload length </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_watch_flush">
<span class="target" id="librados_8h_1aa2b9461868f6bc601d25cceddbfceba2"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_watch_flush</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_watch_flush" title="Permalink to this definition"></a><br /></dt>
<dd><p>Flush watch/notify callbacks</p>
<p>This call will block until all pending watch/notify callbacks have been executed and the queue is empty. It should usually be called after shutting down any watches before shutting down the ioctx or librados to ensure that any callbacks do not misuse the ioctx (for example by calling rados_notify_ack after the ioctx has been destroyed).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- the cluster handle </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_watch_flush">
<span class="target" id="librados_8h_1a95971c74dafd80d7308f1a4987795721"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_watch_flush</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_watch_flush" title="Permalink to this definition"></a><br /></dt>
<dd><p>Flush watch/notify callbacks</p>
<p>This call will be nonblock, and the completion will be called until all pending watch/notify callbacks have been executed and the queue is empty. It should usually be called after shutting down any watches before shutting down the ioctx or librados to ensure that any callbacks do not misuse the ioctx (for example by calling rados_notify_ack after the ioctx has been destroyed).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- the cluster handle </p></li>
<li><p><strong>completion</strong> -- what to do when operation has been attempted </p></li>
</ul>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-mon/osd/pg-commands">Mon/OSD/PG Commands</p>
<p>These interfaces send commands relating to the monitor, OSD, or PGs. </p>
<dl class="c type">
<dt class="sig sig-object c" id="c.rados_log_callback_t">
<span class="target" id="librados_8h_1ab4022414e832a8474f354826b71b9e59"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_log_callback_t</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">line</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">who</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">sec</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">nsec</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">seq</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">level</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">msg</span></span><span class="p"><span class="pre">)</span></span><a class="headerlink" href="#c.rados_log_callback_t" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_log_callback2_t">
<span class="target" id="librados_8h_1a28a8c7f459154f6f705b2d0f44f094d2"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_log_callback2_t</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">line</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">channel</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">who</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">sec</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">nsec</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">seq</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">level</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">msg</span></span><span class="p"><span class="pre">)</span></span><a class="headerlink" href="#c.rados_log_callback2_t" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_mon_command">
<span class="target" id="librados_8h_1a725be20585ca5088dea75cd6190752a9"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_mon_command</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cmd</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">cmdlen</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">inbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">inbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outs</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outslen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_mon_command" title="Permalink to this definition"></a><br /></dt>
<dd><p>Send monitor command.</p>
<p>
The result buffers are allocated on the heap; the caller is expected to release that memory with rados_buffer_free(). The buffer and length pointers can all be NULL, in which case they are not filled in.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Takes command string in carefully-formatted JSON; must match defined commands, types, etc.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
<li><p><strong>cmd</strong> -- an array of char *’s representing the command </p></li>
<li><p><strong>cmdlen</strong> -- count of valid entries in cmd </p></li>
<li><p><strong>inbuf</strong> -- any bulk input data (crush map, etc.) </p></li>
<li><p><strong>inbuflen</strong> -- input buffer length </p></li>
<li><p><strong>outbuf</strong> -- double pointer to output buffer </p></li>
<li><p><strong>outbuflen</strong> -- pointer to output buffer length </p></li>
<li><p><strong>outs</strong> -- double pointer to status string </p></li>
<li><p><strong>outslen</strong> -- pointer to status string length </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_mgr_command">
<span class="target" id="librados_8h_1acdcaa2fc67c0abc47af6368030608e93"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_mgr_command</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cmd</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">cmdlen</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">inbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">inbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outs</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outslen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_mgr_command" title="Permalink to this definition"></a><br /></dt>
<dd><p>Send ceph-mgr command.</p>
<p>
The result buffers are allocated on the heap; the caller is expected to release that memory with rados_buffer_free(). The buffer and length pointers can all be NULL, in which case they are not filled in.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Takes command string in carefully-formatted JSON; must match defined commands, types, etc.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
<li><p><strong>cmd</strong> -- an array of char *’s representing the command </p></li>
<li><p><strong>cmdlen</strong> -- count of valid entries in cmd </p></li>
<li><p><strong>inbuf</strong> -- any bulk input data (crush map, etc.) </p></li>
<li><p><strong>inbuflen</strong> -- input buffer length </p></li>
<li><p><strong>outbuf</strong> -- double pointer to output buffer </p></li>
<li><p><strong>outbuflen</strong> -- pointer to output buffer length </p></li>
<li><p><strong>outs</strong> -- double pointer to status string </p></li>
<li><p><strong>outslen</strong> -- pointer to status string length </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_mgr_command_target">
<span class="target" id="librados_8h_1abce90f0ee3de05293913060f9992a29c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_mgr_command_target</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cmd</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">cmdlen</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">inbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">inbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outs</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outslen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_mgr_command_target" title="Permalink to this definition"></a><br /></dt>
<dd><p>Send ceph-mgr tell command.</p>
<p>
The result buffers are allocated on the heap; the caller is expected to release that memory with rados_buffer_free(). The buffer and length pointers can all be NULL, in which case they are not filled in.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Takes command string in carefully-formatted JSON; must match defined commands, types, etc.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
<li><p><strong>name</strong> -- mgr name to target </p></li>
<li><p><strong>cmd</strong> -- an array of char *’s representing the command </p></li>
<li><p><strong>cmdlen</strong> -- count of valid entries in cmd </p></li>
<li><p><strong>inbuf</strong> -- any bulk input data (crush map, etc.) </p></li>
<li><p><strong>inbuflen</strong> -- input buffer length </p></li>
<li><p><strong>outbuf</strong> -- double pointer to output buffer </p></li>
<li><p><strong>outbuflen</strong> -- pointer to output buffer length </p></li>
<li><p><strong>outs</strong> -- double pointer to status string </p></li>
<li><p><strong>outslen</strong> -- pointer to status string length </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_mon_command_target">
<span class="target" id="librados_8h_1a7720d6756cb0780746d254ea3fe9fba7"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_mon_command_target</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cmd</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">cmdlen</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">inbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">inbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outs</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outslen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_mon_command_target" title="Permalink to this definition"></a><br /></dt>
<dd><p>Send monitor command to a specific monitor.</p>
<p>
The result buffers are allocated on the heap; the caller is expected to release that memory with rados_buffer_free(). The buffer and length pointers can all be NULL, in which case they are not filled in.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Takes command string in carefully-formatted JSON; must match defined commands, types, etc.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
<li><p><strong>name</strong> -- target monitor’s name </p></li>
<li><p><strong>cmd</strong> -- an array of char *’s representing the command </p></li>
<li><p><strong>cmdlen</strong> -- count of valid entries in cmd </p></li>
<li><p><strong>inbuf</strong> -- any bulk input data (crush map, etc.) </p></li>
<li><p><strong>inbuflen</strong> -- input buffer length </p></li>
<li><p><strong>outbuf</strong> -- double pointer to output buffer </p></li>
<li><p><strong>outbuflen</strong> -- pointer to output buffer length </p></li>
<li><p><strong>outs</strong> -- double pointer to status string </p></li>
<li><p><strong>outslen</strong> -- pointer to status string length </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_buffer_free">
<span class="target" id="librados_8h_1a2a122f7d0a43f90d6dcfa22bb33ba6f1"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_buffer_free</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_buffer_free" title="Permalink to this definition"></a><br /></dt>
<dd><p>free a rados-allocated buffer</p>
<p>Release memory allocated by librados calls like rados_mon_command().</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>buf</strong> -- buffer pointer </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_osd_command">
<span class="target" id="librados_8h_1ad3566041d23a88bb8d9c7c19fc1e68d5"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_osd_command</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">osdid</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cmd</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">cmdlen</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">inbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">inbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outs</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outslen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_osd_command" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_pg_command">
<span class="target" id="librados_8h_1ad1389a4d7bb10bf5451d10c51e5c9d59"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_pg_command</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pgstr</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cmd</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">cmdlen</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">inbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">inbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outbuflen</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outs</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outslen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_pg_command" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_monitor_log">
<span class="target" id="librados_8h_1a1abd835b0e239b562e760185cf854f4f"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_monitor_log</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">level</span></span>, <a class="reference internal" href="#c.rados_log_callback_t" title="rados_log_callback_t"><span class="n"><span class="pre">rados_log_callback_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cb</span></span>, <span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_monitor_log" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_monitor_log2">
<span class="target" id="librados_8h_1a6a524b04dabbd3a44fa3b23cb8b78d65"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_monitor_log2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">level</span></span>, <a class="reference internal" href="#c.rados_log_callback2_t" title="rados_log_callback2_t"><span class="n"><span class="pre">rados_log_callback2_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cb</span></span>, <span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_monitor_log2" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_service_register">
<span class="target" id="librados_8h_1a6bb0edda56532d1e5f086c7fe6c7a4c9"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_service_register</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">service</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">daemon</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">metadata_dict</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_service_register" title="Permalink to this definition"></a><br /></dt>
<dd><p>register daemon instance for a service</p>
<p>Register us as a daemon providing a particular service. We identify the service (e.g., ‘rgw’) and our instance name (e.g., ‘rgw.$hostname’). The metadata is a map of keys and values with arbitrary static metdata for this instance. The encoding is a series of NULL-terminated strings, alternating key names and values, terminating with an empty key name. For example, “foo\0bar\0this\0that\0\0” is the dict {foo=bar,this=that}.</p>
<p>For the lifetime of the librados instance, regular beacons will be sent to the cluster to maintain our registration in the service map.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- handle </p></li>
<li><p><strong>service</strong> -- service name </p></li>
<li><p><strong>daemon</strong> -- daemon instance name </p></li>
<li><p><strong>metadata_dict</strong> -- static daemon metadata dict </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_service_update_status">
<span class="target" id="librados_8h_1a889b7718657526c212a1020a44a43c24"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_service_update_status</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">status_dict</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_service_update_status" title="Permalink to this definition"></a><br /></dt>
<dd><p>update daemon status</p>
<p>Update our mutable status information in the service map.</p>
<p>The status dict is encoded the same way the daemon metadata is encoded for rados_service_register. For example, “foo\0bar\0this\0that\0\0” is {foo=bar,this=that}.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- rados cluster handle </p></li>
<li><p><strong>status_dict</strong> -- status dict </p></li>
</ul>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-setup-and-teardown">Setup and Teardown</p>
<p>These are the first and last functions to that should be called when using librados. </p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_create">
<span class="target" id="librados_8h_1a8f736931e798d5c18a4cc982f7cb7d3a"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_create</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">id</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_create" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create a handle for communicating with a RADOS cluster.</p>
<p>Ceph environment variables are read when this is called, so if $CEPH_ARGS specifies everything you need to connect, no further configuration is necessary.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- where to store the handle </p></li>
<li><p><strong>id</strong> -- the user to connect as (i.e. admin, not client.admin) </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_create2">
<span class="target" id="librados_8h_1a405af2c997cc75a787caba49f7380066"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_create2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pcluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">clustername</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">name</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_create2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Extended version of rados_create.</p>
<p>Like rados_create, but 1) don’t assume ‘client.’+id; allow full specification of name 2) allow specification of cluster name 3) flags for future expansion </p>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_create_with_context">
<span class="target" id="librados_8h_1a26f8ad8a3ac50d811c59f1659b39ee51"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_create_with_context</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cluster</span></span>, <a class="reference internal" href="#c.rados_config_t" title="rados_config_t"><span class="n"><span class="pre">rados_config_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cct</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_create_with_context" title="Permalink to this definition"></a><br /></dt>
<dd><p>Initialize a cluster handle from an existing configuration.</p>
<p>Share configuration state with another rados_t instance.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- where to store the handle </p></li>
<li><p><strong>cct</strong> -- the existing configuration to use </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ping_monitor">
<span class="target" id="librados_8h_1a0cdcb316d629a4820c1c6da432b85fe4"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ping_monitor</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">mon_id</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outstr</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">outstrlen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ping_monitor" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ping the monitor with ID mon_id, storing the resulting reply in buf (if specified) with a maximum size of len.</p>
<p>The result buffer is allocated on the heap; the caller is expected to release that memory with rados_buffer_free(). The buffer and length pointers can be NULL, in which case they are not filled in.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
<li><p><strong>mon_id</strong> -- [in] ID of the monitor to ping </p></li>
<li><p><strong>outstr</strong> -- [out] double pointer with the resulting reply </p></li>
<li><p><strong>outstrlen</strong> -- [out] pointer with the size of the reply in outstr </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_connect">
<span class="target" id="librados_8h_1a39664ef8912d13251d649714e287179f"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_connect</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_connect" title="Permalink to this definition"></a><br /></dt>
<dd><p>Connect to the cluster.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: Before calling this, calling a function that communicates with the cluster will crash.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- The cluster to connect to. </p></li>
</ul>
</dd>
<dt class="field-even">Pre<span class="colon">:</span></dt>
<dd class="field-even"><p>The cluster handle is configured with at least a monitor address. If cephx is enabled, a client name and secret must also be set.</p>
</dd>
<dt class="field-odd">Post<span class="colon">:</span></dt>
<dd class="field-odd"><p>If this succeeds, any function in librados may be used</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_shutdown">
<span class="target" id="librados_8h_1a2932bad265c0c96a1862c1fc3b543840"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_shutdown</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_shutdown" title="Permalink to this definition"></a><br /></dt>
<dd><p>Disconnects from the cluster.</p>
<p>For clean up, this is only necessary after rados_connect() has succeeded.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This does not guarantee any asynchronous writes have completed. To do that, you must call rados_aio_flush() on all open io contexts.</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>We implicitly call rados_watch_flush() on shutdown. If there are watches being used, this should be done explicitly before destroying the relevant IoCtx. We do it here as a safety measure.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- the cluster to shutdown </p></li>
</ul>
</dd>
<dt class="field-even">Post<span class="colon">:</span></dt>
<dd class="field-even"><p>the cluster handle cannot be used again</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-configuration">Configuration</p>
<p>These functions read and update Ceph configuration for a cluster handle. Any configuration changes must be done before connecting to the cluster.</p>
<p>Options that librados users might want to set include:<ul class="simple">
<li><p>mon_host</p></li>
<li><p>auth_supported</p></li>
<li><p>key, keyfile, or keyring when using cephx</p></li>
<li><p>log_file, log_to_stderr, err_to_stderr, and log_to_syslog</p></li>
<li><p>debug_rados, debug_objecter, debug_monc, debug_auth, or debug_ms</p></li>
</ul>
</p>
<p>See docs.ceph.com for information about available configuration options` </p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_conf_read_file">
<span class="target" id="librados_8h_1a280e071e73202dca849472814a585717"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_conf_read_file</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">path</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_conf_read_file" title="Permalink to this definition"></a><br /></dt>
<dd><p>Configure the cluster handle using a Ceph config file</p>
<p>If path is NULL, the default locations are searched, and the first found is used. The locations are:<ul class="simple">
<li><p>$CEPH_CONF (environment variable)</p></li>
<li><p>/etc/ceph/ceph.conf</p></li>
<li><p>~/.ceph/config</p></li>
<li><p>ceph.conf (in the current working directory)</p></li>
</ul>
</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle to configure </p></li>
<li><p><strong>path</strong> -- path to a Ceph configuration file </p></li>
</ul>
</dd>
<dt class="field-even">Pre<span class="colon">:</span></dt>
<dd class="field-even"><p>rados_connect() has not been called on the cluster handle</p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_conf_parse_argv">
<span class="target" id="librados_8h_1a270d335aad099c729786f993d7a40548"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_conf_parse_argv</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">argc</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">argv</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_conf_parse_argv" title="Permalink to this definition"></a><br /></dt>
<dd><p>Configure the cluster handle with command line arguments</p>
<p>argv can contain any common Ceph command line option, including any configuration parameter prefixed by ‘&amp;#8212;’ and replacing spaces with dashes or underscores. For example, the following options are equivalent:<ul class="simple">
<li><p>&amp;#8212;mon-host 10.0.0.1:6789</p></li>
<li><p>&amp;#8212;mon_host 10.0.0.1:6789</p></li>
<li><p>-m 10.0.0.1:6789</p></li>
</ul>
</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle to configure </p></li>
<li><p><strong>argc</strong> -- number of arguments in argv </p></li>
<li><p><strong>argv</strong> -- arguments to parse </p></li>
</ul>
</dd>
<dt class="field-even">Pre<span class="colon">:</span></dt>
<dd class="field-even"><p>rados_connect() has not been called on the cluster handle</p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_conf_parse_argv_remainder">
<span class="target" id="librados_8h_1ae95546b66c08a8cdcb381a5a2cda0291"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_conf_parse_argv_remainder</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">argc</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">argv</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">remargv</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_conf_parse_argv_remainder" title="Permalink to this definition"></a><br /></dt>
<dd><p>Configure the cluster handle with command line arguments, returning any remainders. Same rados_conf_parse_argv, except for extra remargv argument to hold returns unrecognized arguments.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle to configure </p></li>
<li><p><strong>argc</strong> -- number of arguments in argv </p></li>
<li><p><strong>argv</strong> -- arguments to parse </p></li>
<li><p><strong>remargv</strong> -- char* array for returned unrecognized arguments </p></li>
</ul>
</dd>
<dt class="field-even">Pre<span class="colon">:</span></dt>
<dd class="field-even"><p>rados_connect() has not been called on the cluster handle</p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_conf_parse_env">
<span class="target" id="librados_8h_1a13aca767869e200385fe28771733c73e"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_conf_parse_env</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">var</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_conf_parse_env" title="Permalink to this definition"></a><br /></dt>
<dd><p>Configure the cluster handle based on an environment variable</p>
<p>The contents of the environment variable are parsed as if they were Ceph command line options. If var is NULL, the CEPH_ARGS environment variable is used.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>BUG: this is not threadsafe - it uses a static buffer</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle to configure </p></li>
<li><p><strong>var</strong> -- name of the environment variable to read </p></li>
</ul>
</dd>
<dt class="field-even">Pre<span class="colon">:</span></dt>
<dd class="field-even"><p>rados_connect() has not been called on the cluster handle</p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_conf_set">
<span class="target" id="librados_8h_1a8f8798efd28e7a97ea8e11a0157d787c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_conf_set</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">option</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_conf_set" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set a configuration option</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle to configure </p></li>
<li><p><strong>option</strong> -- option to set </p></li>
<li><p><strong>value</strong> -- value of the option </p></li>
</ul>
</dd>
<dt class="field-even">Pre<span class="colon">:</span></dt>
<dd class="field-even"><p>rados_connect() has not been called on the cluster handle</p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>-ENOENT when the option is not a Ceph configuration option </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_conf_get">
<span class="target" id="librados_8h_1a85f18e91b8feae214cfb69f30fee2d9c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_conf_get</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">option</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_conf_get" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the value of a configuration option</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- configuration to read </p></li>
<li><p><strong>option</strong> -- which option to read </p></li>
<li><p><strong>buf</strong> -- where to write the configuration value </p></li>
<li><p><strong>len</strong> -- the size of buf in bytes </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ENAMETOOLONG if the buffer is too short to contain the requested value </p>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-pools">Pools</p>
<p>RADOS pools are separate namespaces for objects. Pools may have different crush rules associated with them, so they could have differing replication levels or placement strategies. RADOS permissions are also tied to pools - users can have different read, write, and execute permissions on a per-pool basis. </p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_pool_list">
<span class="target" id="librados_8h_1a5c9ddc1b6c592a87b0e472b0cc5a7a7b"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_pool_list</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_pool_list" title="Permalink to this definition"></a><br /></dt>
<dd><p>List pools</p>
<p>Gets a list of pool names as NULL-terminated strings. The pool names will be placed in the supplied buffer one after another. After the last pool name, there will be two 0 bytes in a row.</p>
<p>If len is too short to fit all the pool name entries we need, we will fill as much as we can.</p>
<p>Buf may be null to determine the buffer size needed to list all pools.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
<li><p><strong>buf</strong> -- output buffer </p></li>
<li><p><strong>len</strong> -- output buffer length </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>length of the buffer we would need to list all pools </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_inconsistent_pg_list">
<span class="target" id="librados_8h_1a5fdd91eaa3340368e77573bfa98f7d1b"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_inconsistent_pg_list</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="n"><span class="pre">int64_t</span></span><span class="w"> </span><span class="n"><span class="pre">pool</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_inconsistent_pg_list" title="Permalink to this definition"></a><br /></dt>
<dd><p>List inconsistent placement groups of the given pool</p>
<p>Gets a list of inconsistent placement groups as NULL-terminated strings. The placement group names will be placed in the supplied buffer one after another. After the last name, there will be two 0 types in a row.</p>
<p>If len is too short to fit all the placement group entries we need, we will fill as much as we can.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
<li><p><strong>pool</strong> -- pool ID </p></li>
<li><p><strong>buf</strong> -- output buffer </p></li>
<li><p><strong>len</strong> -- output buffer length </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>length of the buffer we would need to list all pools </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_cct">
<span class="target" id="librados_8h_1a8d8d85208ce66775e4125072ca41e97f"></span><a class="reference internal" href="#c.rados_config_t" title="rados_config_t"><span class="n"><span class="pre">rados_config_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_cct</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_cct" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get a configuration handle for a rados cluster handle</p>
<p>This handle is valid only as long as the cluster handle is valid.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>config handle for this cluster </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_get_instance_id">
<span class="target" id="librados_8h_1a4fd24b2d710d47a585c561353fb021eb"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_get_instance_id</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_get_instance_id" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get a global id for current instance</p>
<p>This id is a unique representation of current connection to the cluster</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>instance global id </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_get_min_compatible_osd">
<span class="target" id="librados_8h_1add39b0818386b6bd48de9cd46a1c7749"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_get_min_compatible_osd</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="n"><span class="pre">int8_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">require_osd_release</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_get_min_compatible_osd" title="Permalink to this definition"></a><br /></dt>
<dd><p>Gets the minimum compatible OSD version</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
<li><p><strong>require_osd_release</strong> -- [out] minimum compatible OSD version based upon the current features </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on sucess, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_get_min_compatible_client">
<span class="target" id="librados_8h_1a0748f7400f14cdaa475df510856e9cef"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_get_min_compatible_client</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="n"><span class="pre">int8_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">min_compat_client</span></span>, <span class="n"><span class="pre">int8_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">require_min_compat_client</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_get_min_compatible_client" title="Permalink to this definition"></a><br /></dt>
<dd><p>Gets the minimum compatible client version</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
<li><p><strong>min_compat_client</strong> -- [out] minimum compatible client version based upon the current features </p></li>
<li><p><strong>require_min_compat_client</strong> -- [out] required minimum client version based upon explicit setting </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_create">
<span class="target" id="librados_8h_1a19b355a0558d6f4d5ac69001f3d9b791"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_create</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pool_name</span></span>, <a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">ioctx</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_create" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create an io context</p>
<p>The io context allows you to perform operations within a particular pool. For more details see rados_ioctx_t.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- which cluster the pool is in </p></li>
<li><p><strong>pool_name</strong> -- name of the pool </p></li>
<li><p><strong>ioctx</strong> -- where to store the io context </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_create2">
<span class="target" id="librados_8h_1a7d2bae2c8482db63bc2e43ad6945b3d3"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_create2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="n"><span class="pre">int64_t</span></span><span class="w"> </span><span class="n"><span class="pre">pool_id</span></span>, <a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">ioctx</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_create2" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_destroy">
<span class="target" id="librados_8h_1a04442bca05b15538398ab1a43c0520d5"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_destroy</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_destroy" title="Permalink to this definition"></a><br /></dt>
<dd><p>The opposite of rados_ioctx_create</p>
<p>This just tells librados that you no longer need to use the io context. It may not be freed immediately if there are pending asynchronous requests on it, but you should not use an io context again after calling this function on it.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This does not guarantee any asynchronous writes have completed. You must call rados_aio_flush() on the io context before destroying it to do that.</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>If this ioctx is used by rados_watch, the caller needs to be sure that all registered watches are disconnected via rados_unwatch() and that rados_watch_flush() is called. This ensures that a racing watch callback does not make use of a destroyed ioctx.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context to dispose of </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_cct">
<span class="target" id="librados_8h_1a8c160c18753ed10a30cb25610f6417e3"></span><a class="reference internal" href="#c.rados_config_t" title="rados_config_t"><span class="n"><span class="pre">rados_config_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_cct</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_cct" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get configuration handle for a pool handle</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- pool handle </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>rados_config_t for this cluster </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_get_cluster">
<span class="target" id="librados_8h_1aa936689108b5c89ff61e30a16a521ede"></span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_get_cluster</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_get_cluster" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the cluster handle used by this rados_ioctx_t Note that this is a weak reference, and should not be destroyed via rados_shutdown().</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the cluster handle for this io context </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_pool_stat">
<span class="target" id="librados_8h_1aca1a1d5550ab90b24184eba414d7a146"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_pool_stat</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="#c.rados_pool_stat_t" title="rados_pool_stat_t"><span class="n"><span class="pre">rados_pool_stat_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">stats</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_pool_stat" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get pool usage statistics</p>
<p>Fills in a <a class="reference internal" href="#structrados__pool__stat__t"><span class="std std-ref">rados_pool_stat_t</span></a> after querying the cluster.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- determines which pool to query </p></li>
<li><p><strong>stats</strong> -- where to store the results </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_pool_lookup">
<span class="target" id="librados_8h_1afeb8a83236cf84e8d50c03ad7f845996"></span><span class="n"><span class="pre">int64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_pool_lookup</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pool_name</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_pool_lookup" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the id of a pool</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- which cluster the pool is in </p></li>
<li><p><strong>pool_name</strong> -- which pool to look up </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>id of the pool </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ENOENT if the pool is not found </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_pool_reverse_lookup">
<span class="target" id="librados_8h_1acbd3ca91c5cad03ac7c14de1b3df6fc9"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_pool_reverse_lookup</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="n"><span class="pre">int64_t</span></span><span class="w"> </span><span class="n"><span class="pre">id</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">maxlen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_pool_reverse_lookup" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the name of a pool</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- which cluster the pool is in </p></li>
<li><p><strong>id</strong> -- the id of the pool </p></li>
<li><p><strong>buf</strong> -- where to store the pool name </p></li>
<li><p><strong>maxlen</strong> -- size of buffer where name will be stored </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>length of string stored, or -ERANGE if buffer too small </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_pool_create">
<span class="target" id="librados_8h_1a8f574b1fdc0383c1e328211747f39d94"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_pool_create</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pool_name</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_pool_create" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create a pool with default settings</p>
<p>The default crush rule is rule 0.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- the cluster in which the pool will be created </p></li>
<li><p><strong>pool_name</strong> -- the name of the new pool </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_pool_create_with_auid">
<span class="target" id="librados_8h_1a71f395a1283f6d3f72f7c89003913c19"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_pool_create_with_auid</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pool_name</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">auid</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_pool_create_with_auid" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create a pool owned by a specific auid.</p>
<p>DEPRECATED: auid support has been removed, and this call will be removed in a future release.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- the cluster in which the pool will be created </p></li>
<li><p><strong>pool_name</strong> -- the name of the new pool </p></li>
<li><p><strong>auid</strong> -- the id of the owner of the new pool </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_pool_create_with_crush_rule">
<span class="target" id="librados_8h_1ad35aab2bef40ac5cccaccaa9a5bb9d89"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_pool_create_with_crush_rule</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pool_name</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">crush_rule_num</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_pool_create_with_crush_rule" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create a pool with a specific CRUSH rule</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- the cluster in which the pool will be created </p></li>
<li><p><strong>pool_name</strong> -- the name of the new pool </p></li>
<li><p><strong>crush_rule_num</strong> -- which rule to use for placement in the new pool1 </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_pool_create_with_all">
<span class="target" id="librados_8h_1a6bea50ea8aa8a86d70230a7e8e6544ad"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_pool_create_with_all</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pool_name</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">auid</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">crush_rule_num</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_pool_create_with_all" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create a pool with a specific CRUSH rule and auid</p>
<p>DEPRECATED: auid support has been removed and this call will be removed in a future release.</p>
<p>This is a combination of rados_pool_create_with_crush_rule() and rados_pool_create_with_auid().</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- the cluster in which the pool will be created </p></li>
<li><p><strong>pool_name</strong> -- the name of the new pool </p></li>
<li><p><strong>crush_rule_num</strong> -- which rule to use for placement in the new pool2 </p></li>
<li><p><strong>auid</strong> -- the id of the owner of the new pool </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_pool_get_base_tier">
<span class="target" id="librados_8h_1acf6413516ac2525a04a0be8ad322f427"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_pool_get_base_tier</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="n"><span class="pre">int64_t</span></span><span class="w"> </span><span class="n"><span class="pre">pool</span></span>, <span class="n"><span class="pre">int64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">base_tier</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_pool_get_base_tier" title="Permalink to this definition"></a><br /></dt>
<dd><p>Returns the pool that is the base tier for this pool.</p>
<p>The return value is the ID of the pool that should be used to read from/write to. If tiering is not set up for the pool, returns <code class="docutils literal notranslate"><span class="pre">pool</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- the cluster the pool is in </p></li>
<li><p><strong>pool</strong> -- ID of the pool to query </p></li>
<li><p><strong>base_tier</strong> -- [out] base tier, or <code class="docutils literal notranslate"><span class="pre">pool</span></code> if tiering is not configured </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_pool_delete">
<span class="target" id="librados_8h_1a5a787e7550bab85451912094c1930fed"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_pool_delete</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pool_name</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_pool_delete" title="Permalink to this definition"></a><br /></dt>
<dd><p>Delete a pool and all data inside it</p>
<p>The pool is removed from the cluster immediately, but the actual data is deleted in the background.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- the cluster the pool is in </p></li>
<li><p><strong>pool_name</strong> -- which pool to delete </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_pool_set_auid">
<span class="target" id="librados_8h_1ab3f8f455ef7d554ce7f39b2e3811b948"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_pool_set_auid</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">auid</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_ioctx_pool_set_auid" title="Permalink to this definition"></a><br /></dt>
<dd><p>Attempt to change an io context’s associated auid “owner”</p>
<p>DEPRECATED: auid support has been removed and this call has no effect.</p>
<p>Requires that you have write permission on both the current and new auid.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- reference to the pool to change. </p></li>
<li><p><strong>auid</strong> -- the auid you wish the io to have. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_pool_get_auid">
<span class="target" id="librados_8h_1aec06cf5b3cb83753d7a14325d176a017"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_pool_get_auid</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">auid</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_ioctx_pool_get_auid" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the auid of a pool</p>
<p>DEPRECATED: auid support has been removed and this call always reports CEPH_AUTH_UID_DEFAULT (-1).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- pool to query </p></li>
<li><p><strong>auid</strong> -- where to store the auid </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_pool_requires_alignment">
<span class="target" id="librados_8h_1a4383449e164e8c2bd032a0df092a349e"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_pool_requires_alignment</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_ioctx_pool_requires_alignment" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_pool_requires_alignment2">
<span class="target" id="librados_8h_1ac89d813150d4237ff550e732ffaef3bf"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_pool_requires_alignment2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">req</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_pool_requires_alignment2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Test whether the specified pool requires alignment or not.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- pool to query </p></li>
<li><p><strong>req</strong> -- 1 if alignment is supported, 0 if not. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_pool_required_alignment">
<span class="target" id="librados_8h_1ad8ee1632e818366f9833a009bd59484a"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_pool_required_alignment</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_ioctx_pool_required_alignment" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_pool_required_alignment2">
<span class="target" id="librados_8h_1a8c610b5ec8aa6bda762bd1285733980c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_pool_required_alignment2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">alignment</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_pool_required_alignment2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the alignment flavor of a pool</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- pool to query </p></li>
<li><p><strong>alignment</strong> -- where to store the alignment flavor </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_get_id">
<span class="target" id="librados_8h_1a6455b56034c42b63779991f7e5fa8095"></span><span class="n"><span class="pre">int64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_get_id</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_get_id" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the pool id of the io context</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context to query </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the id of the pool the io context uses </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_get_pool_name">
<span class="target" id="librados_8h_1ae31b99bf9816d9fe20440107c5c2d788"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_get_pool_name</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="n"><span class="pre">maxlen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_get_pool_name" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the pool name of the io context</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context to query </p></li>
<li><p><strong>buf</strong> -- pointer to buffer where name will be stored </p></li>
<li><p><strong>maxlen</strong> -- size of buffer where name will be stored </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>length of string stored, or -ERANGE if buffer too small </p>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-object-locators">Object Locators</p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_locator_set_key">
<span class="target" id="librados_8h_1aace160f89e7183d40e345ec170037ea0"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_locator_set_key</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_locator_set_key" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set the key for mapping objects to pgs within an io context.</p>
<p>The key is used instead of the object name to determine which placement groups an object is put in. This affects all subsequent operations of the io context - until a different locator key is set, all objects in this io context will be placed in the same pg.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context to change </p></li>
<li><p><strong>key</strong> -- the key to use as the object locator, or NULL to discard any previously set key </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_set_namespace">
<span class="target" id="librados_8h_1a65c41c0407c00c9e2a4185c832219ff5"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_set_namespace</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">nspace</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_set_namespace" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set the namespace for objects within an io context</p>
<p>The namespace specification further refines a pool into different domains. The mapping of objects to pgs is also based on this value.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context to change </p></li>
<li><p><strong>nspace</strong> -- the name to use as the namespace, or NULL use the default namespace </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_get_namespace">
<span class="target" id="librados_8h_1a5bd4e5ccb9f8482c95ea38fd3c0cb436"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_get_namespace</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="n"><span class="pre">maxlen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_get_namespace" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the namespace for objects within the io context</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context to query </p></li>
<li><p><strong>buf</strong> -- pointer to buffer where name will be stored </p></li>
<li><p><strong>maxlen</strong> -- size of buffer where name will be stored </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>length of string stored, or -ERANGE if buffer too small </p>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-listing-objects">Listing Objects</p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_nobjects_list_open">
<span class="target" id="librados_8h_1a357a74de6b5c55f7f1dd83f97550aa3c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_nobjects_list_open</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">ctx</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_nobjects_list_open" title="Permalink to this definition"></a><br /></dt>
<dd><p>Start listing objects in a pool</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool to list from </p></li>
<li><p><strong>ctx</strong> -- the handle to store list context in </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_nobjects_list_get_pg_hash_position">
<span class="target" id="librados_8h_1a606769099514eabc94b299dbff7b24b5"></span><span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_nobjects_list_get_pg_hash_position</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">ctx</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_nobjects_list_get_pg_hash_position" title="Permalink to this definition"></a><br /></dt>
<dd><p>Return hash position of iterator, rounded to the current PG</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ctx</strong> -- iterator marking where you are in the listing </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>current hash position, rounded to the current pg </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_nobjects_list_seek">
<span class="target" id="librados_8h_1a872bcf8d1ae16bc4240ac479d312402b"></span><span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_nobjects_list_seek</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">ctx</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">pos</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_nobjects_list_seek" title="Permalink to this definition"></a><br /></dt>
<dd><p>Reposition object iterator to a different hash position</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ctx</strong> -- iterator marking where you are in the listing </p></li>
<li><p><strong>pos</strong> -- hash position to move to </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>actual (rounded) position we moved to </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_nobjects_list_seek_cursor">
<span class="target" id="librados_8h_1a6f47298403bc7c6320e90cf1f0467ecc"></span><span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_nobjects_list_seek_cursor</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">ctx</span></span>, <a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="n"><span class="pre">cursor</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_nobjects_list_seek_cursor" title="Permalink to this definition"></a><br /></dt>
<dd><p>Reposition object iterator to a different position</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ctx</strong> -- iterator marking where you are in the listing </p></li>
<li><p><strong>cursor</strong> -- position to move to </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>rounded position we moved to </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_nobjects_list_get_cursor">
<span class="target" id="librados_8h_1ab0dbc8e6f1d79ef188ff1a096158e58d"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_nobjects_list_get_cursor</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">ctx</span></span>, <a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cursor</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_nobjects_list_get_cursor" title="Permalink to this definition"></a><br /></dt>
<dd><p>Reposition object iterator to a different position</p>
<p>The returned handle must be released with rados_object_list_cursor_free().</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ctx</strong> -- iterator marking where you are in the listing </p></li>
<li><p><strong>cursor</strong> -- where to store cursor </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_nobjects_list_next">
<span class="target" id="librados_8h_1a5e8893f4d76c6369e6af92d8f50b262e"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_nobjects_list_next</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">ctx</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">entry</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">nspace</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_nobjects_list_next" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the next object name and locator in the pool</p>
<p><em>entry and *key are valid until next call to rados_nobjects_list_</em></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ctx</strong> -- iterator marking where you are in the listing </p></li>
<li><p><strong>entry</strong> -- where to store the name of the entry </p></li>
<li><p><strong>key</strong> -- where to store the object locator (set to NULL to ignore) </p></li>
<li><p><strong>nspace</strong> -- where to store the object namespace (set to NULL to ignore) </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ENOENT when there are no more objects to list </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_nobjects_list_next2">
<span class="target" id="librados_8h_1a6575217454f22833167d83ef5555939f"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_nobjects_list_next2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">ctx</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">entry</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">nspace</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">entry_size</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key_size</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">nspace_size</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_nobjects_list_next2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the next object name, locator and their sizes in the pool</p>
<p>The sizes allow to list objects with \0 (the NUL character) in .e.g <em>entry. Is is unusual see such object names but a bug in a client has risen the need to handle them as well. *entry and *key are valid until next call to rados_nobjects_list_</em></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ctx</strong> -- iterator marking where you are in the listing </p></li>
<li><p><strong>entry</strong> -- where to store the name of the entry </p></li>
<li><p><strong>key</strong> -- where to store the object locator (set to NULL to ignore) </p></li>
<li><p><strong>nspace</strong> -- where to store the object namespace (set to NULL to ignore) </p></li>
<li><p><strong>entry_size</strong> -- where to store the size of name of the entry </p></li>
<li><p><strong>key_size</strong> -- where to store the size of object locator (set to NULL to ignore) </p></li>
<li><p><strong>nspace_size</strong> -- where to store the size of object namespace (set to NULL to ignore) </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ENOENT when there are no more objects to list </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_nobjects_list_close">
<span class="target" id="librados_8h_1a574e2cb8ce809ab5117e1cbf5e743a0c"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_nobjects_list_close</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">ctx</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_nobjects_list_close" title="Permalink to this definition"></a><br /></dt>
<dd><p>Close the object listing handle.</p>
<p>This should be called when the handle is no longer needed. The handle should not be used after it has been closed.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ctx</strong> -- the handle to close </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_object_list_begin">
<span class="target" id="librados_8h_1a7f270d2ff55006e7cfd301246b8f542f"></span><a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_object_list_begin</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_object_list_begin" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get cursor handle pointing to the <em>beginning</em> of a pool.</p>
<p>This is an opaque handle pointing to the start of a pool. It must be released with rados_object_list_cursor_free().</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- ioctx for the pool </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>handle for the pool, NULL on error (pool does not exist) </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_object_list_end">
<span class="target" id="librados_8h_1aae169bda6bd0dc699109bc2027214e1e"></span><a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_object_list_end</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_object_list_end" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get cursor handle pointing to the <em>end</em> of a pool.</p>
<p>This is an opaque handle pointing to the start of a pool. It must be released with rados_object_list_cursor_free().</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- ioctx for the pool </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>handle for the pool, NULL on error (pool does not exist) </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_object_list_is_end">
<span class="target" id="librados_8h_1a1fa3865eed3a0bc0dc0f363132c28b34"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_object_list_is_end</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="n"><span class="pre">cur</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_object_list_is_end" title="Permalink to this definition"></a><br /></dt>
<dd><p>Check if a cursor has reached the end of a pool</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- ioctx </p></li>
<li><p><strong>cur</strong> -- cursor </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>1 if the cursor has reached the end of the pool, 0 otherwise </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_object_list_cursor_free">
<span class="target" id="librados_8h_1a1b2f63ee6926b124b5bf3def4b936209"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_object_list_cursor_free</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="n"><span class="pre">cur</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_object_list_cursor_free" title="Permalink to this definition"></a><br /></dt>
<dd><p>Release a cursor</p>
<p>Release a cursor. The handle may not be used after this point.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- ioctx </p></li>
<li><p><strong>cur</strong> -- cursor </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_object_list_cursor_cmp">
<span class="target" id="librados_8h_1a3f3283bfcb1bac6ed638bf515596bc39"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_object_list_cursor_cmp</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="n"><span class="pre">lhs</span></span>, <a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="n"><span class="pre">rhs</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_object_list_cursor_cmp" title="Permalink to this definition"></a><br /></dt>
<dd><p>Compare two cursor positions</p>
<p>Compare two cursors, and indicate whether the first cursor precedes, matches, or follows the second.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- ioctx </p></li>
<li><p><strong>lhs</strong> -- first cursor </p></li>
<li><p><strong>rhs</strong> -- second cursor </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>-1, 0, or 1 for lhs &lt; rhs, lhs == rhs, or lhs &gt; rhs </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_object_list">
<span class="target" id="librados_8h_1a98fb6ef2edbf3956d2f306cae0dc8b4b"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_object_list</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="n"><span class="pre">start</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="n"><span class="pre">finish</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">result_size</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">filter_buf</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">filter_buf_len</span></span>, <a class="reference internal" href="#c.rados_object_list_item" title="rados_object_list_item"><span class="n"><span class="pre">rados_object_list_item</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">results</span></span>, <a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">next</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_object_list" title="Permalink to this definition"></a><br /></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the number of items set in the results array </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_object_list_free">
<span class="target" id="librados_8h_1a4cb45630751d3033cc2e836bddf87bf2"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_object_list_free</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">result_size</span></span>, <a class="reference internal" href="#c.rados_object_list_item" title="rados_object_list_item"><span class="n"><span class="pre">rados_object_list_item</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">results</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_object_list_free" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_object_list_slice">
<span class="target" id="librados_8h_1a86aa784bc6db5212a083eeb58c83fbd5"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_object_list_slice</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="n"><span class="pre">start</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="n"><span class="pre">finish</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">n</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">m</span></span>, <a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">split_start</span></span>, <a class="reference internal" href="#c.rados_object_list_cursor" title="rados_object_list_cursor"><span class="n"><span class="pre">rados_object_list_cursor</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">split_finish</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_object_list_slice" title="Permalink to this definition"></a><br /></dt>
<dd><p>Obtain cursors delineating a subset of a range. Use this when you want to split up the work of iterating over the global namespace. Expected use case is when you are iterating in parallel, with <code class="docutils literal notranslate"><span class="pre">m</span></code> workers, and each worker taking an id <code class="docutils literal notranslate"><span class="pre">n</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- ioctx </p></li>
<li><p><strong>start</strong> -- start of the range to be sliced up (inclusive) </p></li>
<li><p><strong>finish</strong> -- end of the range to be sliced up (exclusive) </p></li>
<li><p><strong>n</strong> -- which of the m chunks you would like to get cursors for </p></li>
<li><p><strong>m</strong> -- how many chunks to divide start-finish into </p></li>
<li><p><strong>split_start</strong> -- cursor populated with start of the subrange (inclusive) </p></li>
<li><p><strong>split_finish</strong> -- cursor populated with end of the subrange (exclusive) </p></li>
</ul>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-snapshots">Snapshots</p>
<p>RADOS snapshots are based upon sequence numbers that form a snapshot context. They are pool-specific. The snapshot context consists of the current snapshot sequence number for a pool, and an array of sequence numbers at which snapshots were taken, in descending order. Whenever a snapshot is created or deleted, the snapshot sequence number for the pool is increased. To add a new snapshot, the new snapshot sequence number must be increased and added to the snapshot context.</p>
<p>There are two ways to manage these snapshot contexts:<ol class="arabic simple">
<li><p>within the RADOS cluster These are called pool snapshots, and store the snapshot context in the OSDMap. These represent a snapshot of all the objects in a pool.</p></li>
<li><p>within the RADOS clients These are called self-managed snapshots, and push the responsibility for keeping track of the snapshot context to the clients. For every write, the client must send the snapshot context. In librados, this is accomplished with rados_selfmanaged_snap_set_write_ctx(). These are more difficult to manage, but are restricted to specific objects instead of applying to an entire pool. </p></li>
</ol>
</p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_snap_create">
<span class="target" id="librados_8h_1a9d7dccbed905485393db6eea3b061f79"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_snap_create</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">snapname</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_snap_create" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create a pool-wide snapshot</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool to snapshot </p></li>
<li><p><strong>snapname</strong> -- the name of the snapshot </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_snap_remove">
<span class="target" id="librados_8h_1ab255aeeebfb3a49ef4fb5ab864ca892f"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_snap_remove</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">snapname</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_snap_remove" title="Permalink to this definition"></a><br /></dt>
<dd><p>Delete a pool snapshot</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool to delete the snapshot from </p></li>
<li><p><strong>snapname</strong> -- which snapshot to delete </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_snap_rollback">
<span class="target" id="librados_8h_1ac251c773ccfcf8330c6042928fb17766"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_snap_rollback</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">snapname</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_snap_rollback" title="Permalink to this definition"></a><br /></dt>
<dd><p>Rollback an object to a pool snapshot</p>
<p>The contents of the object will be the same as when the snapshot was taken.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool in which the object is stored </p></li>
<li><p><strong>oid</strong> -- the name of the object to rollback </p></li>
<li><p><strong>snapname</strong> -- which snapshot to rollback to </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_rollback">
<span class="target" id="librados_8h_1ae38ad8dafc99d5e5a37f9350ecf35b06"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_rollback</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">snapname</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_rollback" title="Permalink to this definition"></a><br /></dt>
<dd><div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Deprecated: Use rados_ioctx_snap_rollback() instead </p>
</div>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_snap_set_read">
<span class="target" id="librados_8h_1ab4dd19814ef121a66fe47cbbac0ac4d9"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_snap_set_read</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">snap</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_snap_set_read" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set the snapshot from which reads are performed.</p>
<p>Subsequent reads will return data as it was at the time of that snapshot.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context to change </p></li>
<li><p><strong>snap</strong> -- the id of the snapshot to set, or LIBRADOS_SNAP_HEAD for no snapshot (i.e. normal operation) </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_selfmanaged_snap_create">
<span class="target" id="librados_8h_1abaa66ccdbdffe711ad8a27298795e96c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_selfmanaged_snap_create</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">snapid</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_selfmanaged_snap_create" title="Permalink to this definition"></a><br /></dt>
<dd><p>Allocate an ID for a self-managed snapshot</p>
<p>Get a unique ID to put in the snaphot context to create a snapshot. A clone of an object is not created until a write with the new snapshot context is completed.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool in which the snapshot will exist </p></li>
<li><p><strong>snapid</strong> -- where to store the newly allocated snapshot ID </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_ioctx_selfmanaged_snap_create">
<span class="target" id="librados_8h_1a9c8433977e10a95f93edcab7182a250b"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_ioctx_selfmanaged_snap_create</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">snapid</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_ioctx_selfmanaged_snap_create" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_selfmanaged_snap_remove">
<span class="target" id="librados_8h_1ad272291c9cae04b55702ad38b18bbb08"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_selfmanaged_snap_remove</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">snapid</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_selfmanaged_snap_remove" title="Permalink to this definition"></a><br /></dt>
<dd><p>Remove a self-managed snapshot</p>
<p>This increases the snapshot sequence number, which will cause snapshots to be removed lazily.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool in which the snapshot will exist </p></li>
<li><p><strong>snapid</strong> -- where to store the newly allocated snapshot ID </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_ioctx_selfmanaged_snap_remove">
<span class="target" id="librados_8h_1aec34b794c7be45b68e6f4b1931323fa9"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_ioctx_selfmanaged_snap_remove</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">snapid</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_ioctx_selfmanaged_snap_remove" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_selfmanaged_snap_rollback">
<span class="target" id="librados_8h_1a8dc2560562038f9dbc0fb9e044e89c05"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_selfmanaged_snap_rollback</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">snapid</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_selfmanaged_snap_rollback" title="Permalink to this definition"></a><br /></dt>
<dd><p>Rollback an object to a self-managed snapshot</p>
<p>The contents of the object will be the same as when the snapshot was taken.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool in which the object is stored </p></li>
<li><p><strong>oid</strong> -- the name of the object to rollback </p></li>
<li><p><strong>snapid</strong> -- which snapshot to rollback to </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_selfmanaged_snap_set_write_ctx">
<span class="target" id="librados_8h_1a9356a126dd63e95b195774ebb16487b5"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_selfmanaged_snap_set_write_ctx</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">seq</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">snaps</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">num_snaps</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_selfmanaged_snap_set_write_ctx" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set the snapshot context for use when writing to objects</p>
<p>This is stored in the io context, and applies to all future writes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context to change </p></li>
<li><p><strong>seq</strong> -- the newest snapshot sequence number for the pool </p></li>
<li><p><strong>snaps</strong> -- array of snapshots in sorted by descending id </p></li>
<li><p><strong>num_snaps</strong> -- how many snaphosts are in the snaps array </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-EINVAL if snaps are not in descending order </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_snap_list">
<span class="target" id="librados_8h_1a41c3efad2a9b5924c77f8711fcefbe43"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_snap_list</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">snaps</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">maxlen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_snap_list" title="Permalink to this definition"></a><br /></dt>
<dd><p>List all the ids of pool snapshots</p>
<p>If the output array does not have enough space to fit all the snapshots, -ERANGE is returned and the caller should retry with a larger array.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool to read from </p></li>
<li><p><strong>snaps</strong> -- where to store the results </p></li>
<li><p><strong>maxlen</strong> -- the number of rados_snap_t that fit in the snaps array </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>number of snapshots on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ERANGE is returned if the snaps array is too short </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_snap_lookup">
<span class="target" id="librados_8h_1a1065f3d04697045c99a49517dfe1c69b"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_snap_lookup</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">id</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_snap_lookup" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the id of a pool snapshot</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool to read from </p></li>
<li><p><strong>name</strong> -- the snapshot to find </p></li>
<li><p><strong>id</strong> -- where to store the result </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_snap_get_name">
<span class="target" id="librados_8h_1a624a0e2fcff3ab6e6f010afdcfab3b53"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_snap_get_name</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">id</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">maxlen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_snap_get_name" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the name of a pool snapshot</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool to read from </p></li>
<li><p><strong>id</strong> -- the snapshot to find </p></li>
<li><p><strong>name</strong> -- where to store the result </p></li>
<li><p><strong>maxlen</strong> -- the size of the name array </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ERANGE if the name array is too small </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_ioctx_snap_get_stamp">
<span class="target" id="librados_8h_1a9e636eb61d2b7e46c0689752c7e24362"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_snap_get_stamp</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_snap_t" title="rados_snap_t"><span class="n"><span class="pre">rados_snap_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">id</span></span>, <span class="n"><span class="pre">time_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">t</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_ioctx_snap_get_stamp" title="Permalink to this definition"></a><br /></dt>
<dd><p>Find when a pool snapshot occurred</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the snapshot was taken in </p></li>
<li><p><strong>id</strong> -- the snapshot to lookup </p></li>
<li><p><strong>t</strong> -- where to store the result </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-synchronous-i/o">Synchronous I/O</p>
<p>Writes are replicated to a number of OSDs based on the configuration of the pool they are in. These write functions block until data is in memory on all replicas of the object they’re writing to - they are equivalent to doing the corresponding asynchronous write, and the calling rados_ioctx_wait_for_complete(). For greater data safety, use the asynchronous functions and rados_aio_wait_for_safe(). </p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_get_last_version">
<span class="target" id="librados_8h_1af883a8c97c588bcc031ebc3b3e457d56"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_get_last_version</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_get_last_version" title="Permalink to this definition"></a><br /></dt>
<dd><p>Return the version of the last object read or written to.</p>
<p>This exposes the internal version number of the last object read or written via this io context</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context to check </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>last read or written object version </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write">
<span class="target" id="librados_8h_1a6cf8c5adda227cc04f3e20d0704d5e0e"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">off</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write" title="Permalink to this definition"></a><br /></dt>
<dd><p>Write <em>len</em> bytes from <em>buf</em> into the <em>oid</em> object, starting at offset <em>off</em>. The value of <em>len</em> must be &lt;= UINT_MAX/2.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This will never return a positive value not equal to len. </p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context in which the write will occur </p></li>
<li><p><strong>oid</strong> -- name of the object </p></li>
<li><p><strong>buf</strong> -- data to write </p></li>
<li><p><strong>len</strong> -- length of the data, in bytes </p></li>
<li><p><strong>off</strong> -- byte offset in the object to begin writing at </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_full">
<span class="target" id="librados_8h_1afe540c6cf405617e304d9ac77dd899a8"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_full</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_full" title="Permalink to this definition"></a><br /></dt>
<dd><p>Write <em>len</em> bytes from <em>buf</em> into the <em>oid</em> object. The value of <em>len</em> must be &lt;= UINT_MAX/2.</p>
<p>The object is filled with the provided data. If the object exists, it is atomically truncated and then written.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context in which the write will occur </p></li>
<li><p><strong>oid</strong> -- name of the object </p></li>
<li><p><strong>buf</strong> -- data to write </p></li>
<li><p><strong>len</strong> -- length of the data, in bytes </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_writesame">
<span class="target" id="librados_8h_1a00b189431a3f63897a5ee52784c83dce"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_writesame</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">data_len</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">write_len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">off</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_writesame" title="Permalink to this definition"></a><br /></dt>
<dd><p>Write the same <em>data_len</em> bytes from <em>buf</em> multiple times into the <em>oid</em> object. <em>write_len</em> bytes are written in total, which must be a multiple of <em>data_len</em>. The value of <em>write_len</em> and <em>data_len</em> must be &lt;= UINT_MAX/2.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the io context in which the write will occur </p></li>
<li><p><strong>oid</strong> -- name of the object </p></li>
<li><p><strong>buf</strong> -- data to write </p></li>
<li><p><strong>data_len</strong> -- length of the data, in bytes </p></li>
<li><p><strong>write_len</strong> -- the total number of bytes to write </p></li>
<li><p><strong>off</strong> -- byte offset in the object to begin writing at </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_append">
<span class="target" id="librados_8h_1ab143a7b5ece81a5e3c2ddb2f9314d224"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_append</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_append" title="Permalink to this definition"></a><br /></dt>
<dd><p>Append <em>len</em> bytes from <em>buf</em> into the <em>oid</em> object. The value of <em>len</em> must be &lt;= UINT_MAX/2.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context to operate in </p></li>
<li><p><strong>oid</strong> -- the name of the object </p></li>
<li><p><strong>buf</strong> -- the data to append </p></li>
<li><p><strong>len</strong> -- length of buf (in bytes) </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read">
<span class="target" id="librados_8h_1a1f3022a3d3e17326f174148827715b4f"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">off</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read" title="Permalink to this definition"></a><br /></dt>
<dd><p>Read data from an object</p>
<p>The io context determines the snapshot to read from, if any was set by rados_ioctx_snap_set_read().</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to perform the read </p></li>
<li><p><strong>oid</strong> -- the name of the object to read from </p></li>
<li><p><strong>buf</strong> -- where to store the results </p></li>
<li><p><strong>len</strong> -- the number of bytes to read </p></li>
<li><p><strong>off</strong> -- the offset to start reading from in the object </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>number of bytes read on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_checksum">
<span class="target" id="librados_8h_1a25b086959f2b3ab575818bfbf78af636"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_checksum</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <a class="reference internal" href="#c.rados_checksum_type_t" title="rados_checksum_type_t"><span class="n"><span class="pre">rados_checksum_type_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">type</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">init_value</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">init_value_len</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">off</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">chunk_size</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pchecksum</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">checksum_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_checksum" title="Permalink to this definition"></a><br /></dt>
<dd><p>Compute checksum from object data</p>
<p>The io context determines the snapshot to checksum, if any was set by rados_ioctx_snap_set_read(). The length of the init_value and resulting checksum are dependent upon the checksum type:</p>
<p>XXHASH64: le64 XXHASH32: le32 CRC32C: le32</p>
<p>The checksum result is encoded the following manner:</p>
<p>le32 num_checksum_chunks { leXX checksum for chunk (where XX = appropriate size for the checksum type) } * num_checksum_chunks</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to perform the checksum </p></li>
<li><p><strong>oid</strong> -- the name of the object to checksum </p></li>
<li><p><strong>type</strong> -- the checksum algorithm to utilize </p></li>
<li><p><strong>init_value</strong> -- the init value for the algorithm </p></li>
<li><p><strong>init_value_len</strong> -- the length of the init value </p></li>
<li><p><strong>len</strong> -- the number of bytes to checksum </p></li>
<li><p><strong>off</strong> -- the offset to start checksumming in the object </p></li>
<li><p><strong>chunk_size</strong> -- optional length-aligned chunk size for checksums </p></li>
<li><p><strong>pchecksum</strong> -- where to store the checksum result </p></li>
<li><p><strong>checksum_len</strong> -- the number of bytes available for the result </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_remove">
<span class="target" id="librados_8h_1ab9e0841b845e4ca7289a4ab179f211e7"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_remove</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_remove" title="Permalink to this definition"></a><br /></dt>
<dd><p>Delete an object</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This does not delete any snapshots of the object.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool to delete the object from </p></li>
<li><p><strong>oid</strong> -- the name of the object to delete </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_trunc">
<span class="target" id="librados_8h_1adb9c6a15c862a5735f22aecde60472ba"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_trunc</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">size</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_trunc" title="Permalink to this definition"></a><br /></dt>
<dd><p>Resize an object</p>
<p>If this enlarges the object, the new area is logically filled with zeroes. If this shrinks the object, the excess data is removed.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to truncate </p></li>
<li><p><strong>oid</strong> -- the name of the object </p></li>
<li><p><strong>size</strong> -- the new size of the object in bytes </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_cmpext">
<span class="target" id="librados_8h_1abc3bad5fd7b111be4f8f447eb1d3da3c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_cmpext</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cmp_buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">cmp_len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">off</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_cmpext" title="Permalink to this definition"></a><br /></dt>
<dd><p>Compare an on-disk object range with a buffer</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to perform the comparison </p></li>
<li><p><strong>o</strong> -- name of the object </p></li>
<li><p><strong>cmp_buf</strong> -- buffer containing bytes to be compared with object contents </p></li>
<li><p><strong>cmp_len</strong> -- length to compare and size of <code class="docutils literal notranslate"><span class="pre">cmp_buf</span></code> in bytes </p></li>
<li><p><strong>off</strong> -- object byte offset at which to start the comparison </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure, (-MAX_ERRNO - mismatch_off) on mismatch </p>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-xattrs">Xattrs</p>
<p>Extended attributes are stored as extended attributes on the files representing an object on the OSDs. Thus, they have the same limitations as the underlying filesystem. On ext4, this means that the total data stored in xattrs cannot exceed 4KB. </p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_getxattr">
<span class="target" id="librados_8h_1a49f98f83c1e2951b518149fd9036d315"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_getxattr</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_getxattr" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the value of an extended attribute on an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which the attribute is read </p></li>
<li><p><strong>o</strong> -- name of the object </p></li>
<li><p><strong>name</strong> -- which extended attribute to read </p></li>
<li><p><strong>buf</strong> -- where to store the result </p></li>
<li><p><strong>len</strong> -- size of buf in bytes </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>length of xattr value on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_setxattr">
<span class="target" id="librados_8h_1a066d22d59c1dd87170756a4fa420b974"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_setxattr</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_setxattr" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set an extended attribute on an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which xattr is set </p></li>
<li><p><strong>o</strong> -- name of the object </p></li>
<li><p><strong>name</strong> -- which extended attribute to set </p></li>
<li><p><strong>buf</strong> -- what to store in the xattr </p></li>
<li><p><strong>len</strong> -- the number of bytes in buf </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_rmxattr">
<span class="target" id="librados_8h_1a94a8b98ff16026bc76f812efade4f52d"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_rmxattr</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_rmxattr" title="Permalink to this definition"></a><br /></dt>
<dd><p>Delete an extended attribute from an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to delete the xattr </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>name</strong> -- which xattr to delete </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_getxattrs">
<span class="target" id="librados_8h_1a4af860e31c0f1fa8575586c6b56fe4aa"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_getxattrs</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <a class="reference internal" href="#c.rados_xattrs_iter_t" title="rados_xattrs_iter_t"><span class="n"><span class="pre">rados_xattrs_iter_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">iter</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_getxattrs" title="Permalink to this definition"></a><br /></dt>
<dd><p>Start iterating over xattrs on an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to list xattrs </p></li>
<li><p><strong>oid</strong> -- name of the object </p></li>
<li><p><strong>iter</strong> -- where to store the iterator </p></li>
</ul>
</dd>
<dt class="field-even">Post<span class="colon">:</span></dt>
<dd class="field-even"><p>iter is a valid iterator</p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_getxattrs_next">
<span class="target" id="librados_8h_1ae05301a4b78fda5f2c16369f2a5187d4"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_getxattrs_next</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_xattrs_iter_t" title="rados_xattrs_iter_t"><span class="n"><span class="pre">rados_xattrs_iter_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">iter</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_getxattrs_next" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the next xattr on the object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>iter</strong> -- iterator to advance </p></li>
<li><p><strong>name</strong> -- where to store the name of the next xattr </p></li>
<li><p><strong>val</strong> -- where to store the value of the next xattr </p></li>
<li><p><strong>len</strong> -- the number of bytes in val </p></li>
</ul>
</dd>
<dt class="field-even">Pre<span class="colon">:</span></dt>
<dd class="field-even"><p>iter is a valid iterator</p>
</dd>
<dt class="field-odd">Post<span class="colon">:</span></dt>
<dd class="field-odd"><p>name is the NULL-terminated name of the next xattr, and val contains the value of the xattr, which is of length len. If the end of the list has been reached, name and val are NULL, and len is 0.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_getxattrs_end">
<span class="target" id="librados_8h_1a492a7c88fe893161d248d52f197be9e5"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_getxattrs_end</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_xattrs_iter_t" title="rados_xattrs_iter_t"><span class="n"><span class="pre">rados_xattrs_iter_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">iter</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_getxattrs_end" title="Permalink to this definition"></a><br /></dt>
<dd><p>Close the xattr iterator.</p>
<p>iter should not be used after this is called.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>iter</strong> -- the iterator to close </p></li>
</ul>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-asynchronous-xattrs">Asynchronous Xattrs</p>
<p>Extended attributes are stored as extended attributes on the files representing an object on the OSDs. Thus, they have the same limitations as the underlying filesystem. On ext4, this means that the total data stored in xattrs cannot exceed 4KB. </p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_getxattr">
<span class="target" id="librados_8h_1a796b9f9a62082e41edad148983839ca9"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_getxattr</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_getxattr" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously get the value of an extended attribute on an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which the attribute is read </p></li>
<li><p><strong>o</strong> -- name of the object </p></li>
<li><p><strong>completion</strong> -- what to do when the getxattr completes </p></li>
<li><p><strong>name</strong> -- which extended attribute to read </p></li>
<li><p><strong>buf</strong> -- where to store the result </p></li>
<li><p><strong>len</strong> -- size of buf in bytes </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>length of xattr value on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_setxattr">
<span class="target" id="librados_8h_1a48e077c91bf0c88c158969cf24141d86"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_setxattr</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_setxattr" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously set an extended attribute on an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which xattr is set </p></li>
<li><p><strong>o</strong> -- name of the object </p></li>
<li><p><strong>completion</strong> -- what to do when the setxattr completes </p></li>
<li><p><strong>name</strong> -- which extended attribute to set </p></li>
<li><p><strong>buf</strong> -- what to store in the xattr </p></li>
<li><p><strong>len</strong> -- the number of bytes in buf </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_rmxattr">
<span class="target" id="librados_8h_1abf166677354d05ac068797c9e25d47cb"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_rmxattr</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_rmxattr" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously delete an extended attribute from an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to delete the xattr </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>completion</strong> -- what to do when the rmxattr completes </p></li>
<li><p><strong>name</strong> -- which xattr to delete </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_getxattrs">
<span class="target" id="librados_8h_1a10a59a4c338ce787deccced3cfdc1764"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_getxattrs</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <a class="reference internal" href="#c.rados_xattrs_iter_t" title="rados_xattrs_iter_t"><span class="n"><span class="pre">rados_xattrs_iter_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">iter</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_getxattrs" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronously start iterating over xattrs on an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to list xattrs </p></li>
<li><p><strong>oid</strong> -- name of the object </p></li>
<li><p><strong>completion</strong> -- what to do when the getxattrs completes </p></li>
<li><p><strong>iter</strong> -- where to store the iterator </p></li>
</ul>
</dd>
<dt class="field-even">Post<span class="colon">:</span></dt>
<dd class="field-even"><p>iter is a valid iterator</p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-hints">Hints</p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_set_alloc_hint">
<span class="target" id="librados_8h_1ab2442bb8e7da9887097c8a9998e2496f"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_set_alloc_hint</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">expected_object_size</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">expected_write_size</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_set_alloc_hint" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set allocation hint for an object</p>
<p>This is an advisory operation, it will always succeed (as if it was submitted with a LIBRADOS_OP_FLAG_FAILOK flag set) and is not guaranteed to do anything on the backend.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>expected_object_size</strong> -- expected size of the object, in bytes </p></li>
<li><p><strong>expected_write_size</strong> -- expected size of writes to the object, in bytes </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_set_alloc_hint2">
<span class="target" id="librados_8h_1a4432289fb16f5eeee7aa3a708da059a1"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_set_alloc_hint2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">expected_object_size</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">expected_write_size</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_set_alloc_hint2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set allocation hint for an object</p>
<p>This is an advisory operation, it will always succeed (as if it was submitted with a LIBRADOS_OP_FLAG_FAILOK flag set) and is not guaranteed to do anything on the backend.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>expected_object_size</strong> -- expected size of the object, in bytes </p></li>
<li><p><strong>expected_write_size</strong> -- expected size of writes to the object, in bytes </p></li>
<li><p><strong>flags</strong> -- hints about future IO patterns </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-object-operations">Object Operations</p>
<p>A single rados operation can do multiple operations on one object atomically. The whole operation will succeed or fail, and no partial results will be visible.</p>
<p>Operations may be either reads, which can return data, or writes, which cannot. The effects of writes are applied and visible all at once, so an operation that sets an xattr and then checks its value will not see the updated value. </p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_create_write_op">
<span class="target" id="librados_8h_1aebe6d2eff717e7ab4ab7079d4744b261"></span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_create_write_op</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_create_write_op" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create a new rados_write_op_t write operation. This will store all actions to be performed atomically. You must call rados_release_write_op when you are finished with it.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>the ownership of a write operartion is passed to the function performing the operation, so the same instance of <code class="docutils literal notranslate"><span class="pre">rados_write_op_t</span></code> cannot be used again after being performed.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>non-NULL on success, NULL on memory allocation error. </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_release_write_op">
<span class="target" id="librados_8h_1af83ce494204afcbf3f9656af79fee8e4"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_release_write_op</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_release_write_op" title="Permalink to this definition"></a><br /></dt>
<dd><p>Free a rados_write_op_t, must be called when you’re done with it. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to deallocate, created with rados_create_write_op </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_set_flags">
<span class="target" id="librados_8h_1a3d0efd250fd26fa4fe57f49e05abf164"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_set_flags</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_set_flags" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set flags for the last operation added to this write_op. At least one op must have been added to the write_op. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>flags</strong> -- see librados.h constants beginning with LIBRADOS_OP_FLAG </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_assert_exists">
<span class="target" id="librados_8h_1af1211310f095b1de7b87a7bcb8924274"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_assert_exists</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_assert_exists" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that the object exists before writing </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_assert_version">
<span class="target" id="librados_8h_1a992143492f967d726f422103db14619d"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_assert_version</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">ver</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_assert_version" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that the object exists and that its internal version number is equal to “ver” before writing. “ver” should be a version number previously obtained with rados_get_last_version().<ul class="simple">
<li><p>If the object’s version is greater than the asserted version then rados_write_op_operate will return -ERANGE instead of executing the op.</p></li>
<li><p>If the object’s version is less than the asserted version then rados_write_op_operate will return -EOVERFLOW instead of executing the op. </p></li>
</ul>
</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>ver</strong> -- object version number </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_cmpext">
<span class="target" id="librados_8h_1a72b1f302751da125742c8791659e08a4"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_cmpext</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cmp_buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">cmp_len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">off</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_cmpext" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that given object range (extent) satisfies comparison.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>cmp_buf</strong> -- buffer containing bytes to be compared with object contents </p></li>
<li><p><strong>cmp_len</strong> -- length to compare and size of <code class="docutils literal notranslate"><span class="pre">cmp_buf</span></code> in bytes </p></li>
<li><p><strong>off</strong> -- object byte offset at which to start the comparison </p></li>
<li><p><strong>prval</strong> -- returned result of comparison, 0 on success, negative error code on failure, (-MAX_ERRNO - mismatch_off) on mismatch </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_cmpxattr">
<span class="target" id="librados_8h_1ac18c3f01845d814bbce340fa7ee4a0b3"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_cmpxattr</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">comparison_operator</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">value_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_cmpxattr" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that given xattr satisfies comparison. If the comparison is not satisfied, the return code of the operation will be -ECANCELED </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>name</strong> -- name of the xattr to look up </p></li>
<li><p><strong>comparison_operator</strong> -- currently undocumented, look for LIBRADOS_CMPXATTR_OP_EQ in librados.h</p></li>
<li><p><strong>value</strong> -- buffer to compare actual xattr value to </p></li>
<li><p><strong>value_len</strong> -- length of buffer to compare actual xattr value to </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_omap_cmp">
<span class="target" id="librados_8h_1ace6095cfe232f4ddea00b2122a5ffab6"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_omap_cmp</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">comparison_operator</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">val_len</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_omap_cmp" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that the an omap value satisfies a comparison, with the supplied value on the right hand side (i.e. for OP_LT, the comparison is actual_value &lt; value.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>key</strong> -- which omap value to compare </p></li>
<li><p><strong>comparison_operator</strong> -- one of LIBRADOS_CMPXATTR_OP_EQ, LIBRADOS_CMPXATTR_OP_LT, or LIBRADOS_CMPXATTR_OP_GT </p></li>
<li><p><strong>val</strong> -- value to compare with </p></li>
<li><p><strong>val_len</strong> -- length of value in bytes </p></li>
<li><p><strong>prval</strong> -- where to store the return value from this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_omap_cmp2">
<span class="target" id="librados_8h_1a1d53646d5492200203176de0b416123b"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_omap_cmp2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">comparison_operator</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">key_len</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">val_len</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_omap_cmp2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that the an omap value satisfies a comparison, with the supplied value on the right hand side (i.e. for OP_LT, the comparison is actual_value &lt; value.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>key</strong> -- which omap value to compare </p></li>
<li><p><strong>comparison_operator</strong> -- one of LIBRADOS_CMPXATTR_OP_EQ, LIBRADOS_CMPXATTR_OP_LT, or LIBRADOS_CMPXATTR_OP_GT </p></li>
<li><p><strong>val</strong> -- value to compare with </p></li>
<li><p><strong>key_len</strong> -- length of key in bytes </p></li>
<li><p><strong>val_len</strong> -- length of value in bytes </p></li>
<li><p><strong>prval</strong> -- where to store the return value from this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_setxattr">
<span class="target" id="librados_8h_1ae8e587f4e14c5905b668dd594bc85790"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_setxattr</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">value_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_setxattr" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set an xattr </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>name</strong> -- name of the xattr </p></li>
<li><p><strong>value</strong> -- buffer to set xattr to </p></li>
<li><p><strong>value_len</strong> -- length of buffer to set xattr to </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_rmxattr">
<span class="target" id="librados_8h_1a2dfcb8f92b1a356c7271a7119566b0e9"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_rmxattr</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_rmxattr" title="Permalink to this definition"></a><br /></dt>
<dd><p>Remove an xattr </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>name</strong> -- name of the xattr to remove </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_create">
<span class="target" id="librados_8h_1a3101b71e0553badcd67d3c8fb440764b"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_create</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">exclusive</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">category</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_create" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create the object </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>exclusive</strong> -- set to either LIBRADOS_CREATE_EXCLUSIVE or LIBRADOS_CREATE_IDEMPOTENT will error if the object already exists. </p></li>
<li><p><strong>category</strong> -- category string (DEPRECATED, HAS NO EFFECT) </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_write">
<span class="target" id="librados_8h_1a0c48d151b04870a155189fd5e7093ea7"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_write</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buffer</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">offset</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_write" title="Permalink to this definition"></a><br /></dt>
<dd><p>Write to offset </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>offset</strong> -- offset to write to </p></li>
<li><p><strong>buffer</strong> -- bytes to write </p></li>
<li><p><strong>len</strong> -- length of buffer </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_write_full">
<span class="target" id="librados_8h_1a8791dae52ad94b262109dd725ae53cfc"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_write_full</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buffer</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_write_full" title="Permalink to this definition"></a><br /></dt>
<dd><p>Write whole object, atomically replacing it. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>buffer</strong> -- bytes to write </p></li>
<li><p><strong>len</strong> -- length of buffer </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_writesame">
<span class="target" id="librados_8h_1ac33ab34ebc78694bcd814cc5e190b617"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_writesame</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buffer</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">data_len</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">write_len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">offset</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_writesame" title="Permalink to this definition"></a><br /></dt>
<dd><p>Write the same buffer multiple times </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>buffer</strong> -- bytes to write </p></li>
<li><p><strong>data_len</strong> -- length of buffer </p></li>
<li><p><strong>write_len</strong> -- total number of bytes to write, as a multiple of <code class="docutils literal notranslate"><span class="pre">data_len</span></code></p></li>
<li><p><strong>offset</strong> -- offset to write to </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_append">
<span class="target" id="librados_8h_1ad825ea1656b06b77e75b3f6becdbd095"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_append</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buffer</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_append" title="Permalink to this definition"></a><br /></dt>
<dd><p>Append to end of object. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>buffer</strong> -- bytes to write </p></li>
<li><p><strong>len</strong> -- length of buffer </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_remove">
<span class="target" id="librados_8h_1a81f9990c7d3f238d8f7e217dc0a9f752"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_remove</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_remove" title="Permalink to this definition"></a><br /></dt>
<dd><p>Remove object </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_truncate">
<span class="target" id="librados_8h_1aaf20d8ce414ff5352841006399074b00"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_truncate</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">offset</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_truncate" title="Permalink to this definition"></a><br /></dt>
<dd><p>Truncate an object </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>offset</strong> -- Offset to truncate to </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_zero">
<span class="target" id="librados_8h_1a928842f2a924c6e517421bd204995357"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_zero</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">offset</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_zero" title="Permalink to this definition"></a><br /></dt>
<dd><p>Zero part of an object </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>offset</strong> -- Offset to zero </p></li>
<li><p><strong>len</strong> -- length to zero </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_exec">
<span class="target" id="librados_8h_1aba38c8c10b21c41609f4e236685f92dc"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_exec</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cls</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">method</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">in_buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">in_len</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_exec" title="Permalink to this definition"></a><br /></dt>
<dd><p>Execute an OSD class method on an object See rados_exec() for general description.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>cls</strong> -- the name of the class </p></li>
<li><p><strong>method</strong> -- the name of the method </p></li>
<li><p><strong>in_buf</strong> -- where to find input </p></li>
<li><p><strong>in_len</strong> -- length of in_buf in bytes </p></li>
<li><p><strong>prval</strong> -- where to store the return value from the method </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_omap_set">
<span class="target" id="librados_8h_1a9b4b5a5204161db2458ba332350f3050"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_omap_set</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">keys</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">vals</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">lens</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">num</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_omap_set" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set key/value pairs on an object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>keys</strong> -- array of null-terminated char arrays representing keys to set </p></li>
<li><p><strong>vals</strong> -- array of pointers to values to set </p></li>
<li><p><strong>lens</strong> -- array of lengths corresponding to each value </p></li>
<li><p><strong>num</strong> -- number of key/value pairs to set </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_omap_set2">
<span class="target" id="librados_8h_1aa408d269e7e4c9e8d3b321bfdac75919"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_omap_set2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">keys</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">vals</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key_lens</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val_lens</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">num</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_omap_set2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set key/value pairs on an object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>keys</strong> -- array of null-terminated char arrays representing keys to set </p></li>
<li><p><strong>vals</strong> -- array of pointers to values to set </p></li>
<li><p><strong>key_lens</strong> -- array of lengths corresponding to each key </p></li>
<li><p><strong>val_lens</strong> -- array of lengths corresponding to each value </p></li>
<li><p><strong>num</strong> -- number of key/value pairs to set </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_omap_rm_keys">
<span class="target" id="librados_8h_1a690c6a53aef189975151daa02cf9bbe8"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_omap_rm_keys</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">keys</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">keys_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_omap_rm_keys" title="Permalink to this definition"></a><br /></dt>
<dd><p>Remove key/value pairs from an object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>keys</strong> -- array of null-terminated char arrays representing keys to remove </p></li>
<li><p><strong>keys_len</strong> -- number of key/value pairs to remove </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_omap_rm_keys2">
<span class="target" id="librados_8h_1a6384761a6bdee274d569fafa7473a935"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_omap_rm_keys2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">keys</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key_lens</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">keys_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_omap_rm_keys2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Remove key/value pairs from an object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>keys</strong> -- array of char arrays representing keys to remove </p></li>
<li><p><strong>key_lens</strong> -- array of size_t values representing length of each key </p></li>
<li><p><strong>keys_len</strong> -- number of key/value pairs to remove </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_omap_rm_range2">
<span class="target" id="librados_8h_1a699096af9d427063b68e5bc0bddaf950"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_omap_rm_range2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key_begin</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">key_begin_len</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key_end</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">key_end_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_omap_rm_range2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Remove key/value pairs from an object whose keys are in the range [key_begin, key_end)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>key_begin</strong> -- the lower bound of the key range to remove </p></li>
<li><p><strong>key_begin_len</strong> -- length of key_begin </p></li>
<li><p><strong>key_end</strong> -- the upper bound of the key range to remove </p></li>
<li><p><strong>key_end_len</strong> -- length of key_end </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_omap_clear">
<span class="target" id="librados_8h_1aa39f0d760f4771868ea0c40daedb881d"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_omap_clear</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_omap_clear" title="Permalink to this definition"></a><br /></dt>
<dd><p>Remove all key/value pairs from an object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_set_alloc_hint">
<span class="target" id="librados_8h_1a2cafdfb236363d88a5a5faac92aa32c9"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_set_alloc_hint</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">expected_object_size</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">expected_write_size</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_set_alloc_hint" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set allocation hint for an object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>expected_object_size</strong> -- expected size of the object, in bytes </p></li>
<li><p><strong>expected_write_size</strong> -- expected size of writes to the object, in bytes </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_set_alloc_hint2">
<span class="target" id="librados_8h_1a225853b53348d29192b1325131ea5764"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_set_alloc_hint2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">expected_object_size</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">expected_write_size</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_set_alloc_hint2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set allocation hint for an object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to add this action to </p></li>
<li><p><strong>expected_object_size</strong> -- expected size of the object, in bytes </p></li>
<li><p><strong>expected_write_size</strong> -- expected size of writes to the object, in bytes </p></li>
<li><p><strong>flags</strong> -- hints about future IO patterns </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_operate">
<span class="target" id="librados_8h_1aa82db76eb61913b5eb44e54189901ace"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_operate</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="n"><span class="pre">time_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">mtime</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_operate" title="Permalink to this definition"></a><br /></dt>
<dd><p>Perform a write operation synchronously </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to perform </p></li>
<li><p><strong>io</strong> -- the ioctx that the object is in </p></li>
<li><p><strong>oid</strong> -- the object id </p></li>
<li><p><strong>mtime</strong> -- the time to set the mtime to, NULL for the current time </p></li>
<li><p><strong>flags</strong> -- flags to apply to the entire operation (LIBRADOS_OPERATION_*) </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_write_op_operate2">
<span class="target" id="librados_8h_1acc0b68dbb8338c98e7ed25b0295371b4"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_operate2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">timespec</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">mtime</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_write_op_operate2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Perform a write operation synchronously </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to perform </p></li>
<li><p><strong>io</strong> -- the ioctx that the object is in </p></li>
<li><p><strong>oid</strong> -- the object id </p></li>
<li><p><strong>mtime</strong> -- the time to set the mtime to, NULL for the current time </p></li>
<li><p><strong>flags</strong> -- flags to apply to the entire operation (LIBRADOS_OPERATION_*) </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_write_op_operate">
<span class="target" id="librados_8h_1a0b60a58198ee2aa2a1b78caef7e4b1a7"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_write_op_operate</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="n"><span class="pre">time_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">mtime</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_write_op_operate" title="Permalink to this definition"></a><br /></dt>
<dd><p>Perform a write operation asynchronously </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to perform </p></li>
<li><p><strong>io</strong> -- the ioctx that the object is in </p></li>
<li><p><strong>completion</strong> -- what to do when operation has been attempted </p></li>
<li><p><strong>oid</strong> -- the object id </p></li>
<li><p><strong>mtime</strong> -- the time to set the mtime to, NULL for the current time </p></li>
<li><p><strong>flags</strong> -- flags to apply to the entire operation (LIBRADOS_OPERATION_*) </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_write_op_operate2">
<span class="target" id="librados_8h_1ac015fb2c87aef32c2bb30c35b3bb91e1"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_write_op_operate2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_write_op_t" title="rados_write_op_t"><span class="n"><span class="pre">rados_write_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">write_op</span></span>, <a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">timespec</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">mtime</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_write_op_operate2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Perform a write operation asynchronously </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>write_op</strong> -- operation to perform </p></li>
<li><p><strong>io</strong> -- the ioctx that the object is in </p></li>
<li><p><strong>completion</strong> -- what to do when operation has been attempted </p></li>
<li><p><strong>oid</strong> -- the object id </p></li>
<li><p><strong>mtime</strong> -- the time to set the mtime to, NULL for the current time </p></li>
<li><p><strong>flags</strong> -- flags to apply to the entire operation (LIBRADOS_OPERATION_*) </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_create_read_op">
<span class="target" id="librados_8h_1a64d105741f9a282b89f29f14823f4968"></span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_create_read_op</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_create_read_op" title="Permalink to this definition"></a><br /></dt>
<dd><p>Create a new rados_read_op_t read operation. This will store all actions to be performed atomically. You must call rados_release_read_op when you are finished with it (after it completes, or you decide not to send it in the first place).</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>the ownership of a read operartion is passed to the function performing the operation, so the same instance of <code class="docutils literal notranslate"><span class="pre">rados_read_op_t</span></code> cannot be used again after being performed.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>non-NULL on success, NULL on memory allocation error. </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_release_read_op">
<span class="target" id="librados_8h_1aec4360f5fe8a66ad25d073ea42f4981a"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_release_read_op</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_release_read_op" title="Permalink to this definition"></a><br /></dt>
<dd><p>Free a rados_read_op_t, must be called when you’re done with it. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to deallocate, created with rados_create_read_op </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_set_flags">
<span class="target" id="librados_8h_1aa6348fd91f353cfc89ea56f9ed974c8f"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_set_flags</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_set_flags" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set flags for the last operation added to this read_op. At least one op must have been added to the read_op. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>flags</strong> -- see librados.h constants beginning with LIBRADOS_OP_FLAG </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_assert_exists">
<span class="target" id="librados_8h_1ac12c2be89016fd89b2ce5c553beab377"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_assert_exists</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_assert_exists" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that the object exists before reading </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_assert_version">
<span class="target" id="librados_8h_1a2d8b878bdc3d05626a497897efb51483"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_assert_version</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">ver</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_assert_version" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that the object exists and that its internal version number is equal to “ver” before reading. “ver” should be a version number previously obtained with rados_get_last_version().<ul class="simple">
<li><p>If the object’s version is greater than the asserted version then rados_read_op_operate will return -ERANGE instead of executing the op.</p></li>
<li><p>If the object’s version is less than the asserted version then rados_read_op_operate will return -EOVERFLOW instead of executing the op. </p></li>
</ul>
</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>ver</strong> -- object version number </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_cmpext">
<span class="target" id="librados_8h_1a24c17c4cc376750c9c55fb9196a9b3fe"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_cmpext</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cmp_buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">cmp_len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">off</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_cmpext" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that given object range (extent) satisfies comparison.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>cmp_buf</strong> -- buffer containing bytes to be compared with object contents </p></li>
<li><p><strong>cmp_len</strong> -- length to compare and size of <code class="docutils literal notranslate"><span class="pre">cmp_buf</span></code> in bytes </p></li>
<li><p><strong>off</strong> -- object byte offset at which to start the comparison </p></li>
<li><p><strong>prval</strong> -- returned result of comparison, 0 on success, negative error code on failure, (-MAX_ERRNO - mismatch_off) on mismatch </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_cmpxattr">
<span class="target" id="librados_8h_1a61e8e72bd62506b55c5e9378f44ff242"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_cmpxattr</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">comparison_operator</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">value_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_cmpxattr" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that the an xattr satisfies a comparison If the comparison is not satisfied, the return code of the operation will be -ECANCELED </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>name</strong> -- name of the xattr to look up </p></li>
<li><p><strong>comparison_operator</strong> -- currently undocumented, look for LIBRADOS_CMPXATTR_OP_EQ in librados.h</p></li>
<li><p><strong>value</strong> -- buffer to compare actual xattr value to </p></li>
<li><p><strong>value_len</strong> -- length of buffer to compare actual xattr value to </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_getxattrs">
<span class="target" id="librados_8h_1a3028474b7b51ca30fa09312a79421489"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_getxattrs</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <a class="reference internal" href="#c.rados_xattrs_iter_t" title="rados_xattrs_iter_t"><span class="n"><span class="pre">rados_xattrs_iter_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">iter</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_getxattrs" title="Permalink to this definition"></a><br /></dt>
<dd><p>Start iterating over xattrs on an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>iter</strong> -- where to store the iterator </p></li>
<li><p><strong>prval</strong> -- where to store the return value of this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_omap_cmp">
<span class="target" id="librados_8h_1aba4f863a2b901f9af0e8c9ce82d95aed"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_omap_cmp</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">comparison_operator</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">val_len</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_omap_cmp" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that the an omap value satisfies a comparison, with the supplied value on the right hand side (i.e. for OP_LT, the comparison is actual_value &lt; value.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>key</strong> -- which omap value to compare </p></li>
<li><p><strong>comparison_operator</strong> -- one of LIBRADOS_CMPXATTR_OP_EQ, LIBRADOS_CMPXATTR_OP_LT, or LIBRADOS_CMPXATTR_OP_GT </p></li>
<li><p><strong>val</strong> -- value to compare with </p></li>
<li><p><strong>val_len</strong> -- length of value in bytes </p></li>
<li><p><strong>prval</strong> -- where to store the return value from this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_omap_cmp2">
<span class="target" id="librados_8h_1adb828a3c7212fe4db3c3d2eca7df78bd"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_omap_cmp2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">comparison_operator</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">key_len</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">val_len</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_omap_cmp2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Ensure that the an omap value satisfies a comparison, with the supplied value on the right hand side (i.e. for OP_LT, the comparison is actual_value &lt; value.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>key</strong> -- which omap value to compare </p></li>
<li><p><strong>comparison_operator</strong> -- one of LIBRADOS_CMPXATTR_OP_EQ, LIBRADOS_CMPXATTR_OP_LT, or LIBRADOS_CMPXATTR_OP_GT </p></li>
<li><p><strong>val</strong> -- value to compare with </p></li>
<li><p><strong>key_len</strong> -- length of key in bytes </p></li>
<li><p><strong>val_len</strong> -- length of value in bytes </p></li>
<li><p><strong>prval</strong> -- where to store the return value from this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_stat">
<span class="target" id="librados_8h_1ad155090a5c12c51369a161f953ea5fc0"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_stat</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">psize</span></span>, <span class="n"><span class="pre">time_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pmtime</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_stat" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get object size and mtime </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>psize</strong> -- where to store object size </p></li>
<li><p><strong>pmtime</strong> -- where to store modification time </p></li>
<li><p><strong>prval</strong> -- where to store the return value of this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_stat2">
<span class="target" id="librados_8h_1a90ab8be675c9c67a8695d796803d2f06"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_stat2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">psize</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">timespec</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pmtime</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_stat2" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_read">
<span class="target" id="librados_8h_1af0eaa6aee97b223688c87560b8609223"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_read</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">offset</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buffer</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">bytes_read</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_read" title="Permalink to this definition"></a><br /></dt>
<dd><p>Read bytes from offset into buffer.</p>
<p>prlen will be filled with the number of bytes read if successful. A short read can only occur if the read reaches the end of the object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>offset</strong> -- offset to read from </p></li>
<li><p><strong>len</strong> -- length of buffer </p></li>
<li><p><strong>buffer</strong> -- where to put the data </p></li>
<li><p><strong>bytes_read</strong> -- where to store the number of bytes read by this action </p></li>
<li><p><strong>prval</strong> -- where to store the return value of this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_checksum">
<span class="target" id="librados_8h_1a8060d9fa871d43db56395455fcea6347"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_checksum</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <a class="reference internal" href="#c.rados_checksum_type_t" title="rados_checksum_type_t"><span class="n"><span class="pre">rados_checksum_type_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">type</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">init_value</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">init_value_len</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">offset</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">chunk_size</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pchecksum</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">checksum_len</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_checksum" title="Permalink to this definition"></a><br /></dt>
<dd><p>Compute checksum from object data</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>type</strong> -- the checksum algorithm to utilize </p></li>
<li><p><strong>init_value</strong> -- the init value for the algorithm </p></li>
<li><p><strong>init_value_len</strong> -- the length of the init value </p></li>
<li><p><strong>offset</strong> -- the offset to start checksumming in the object </p></li>
<li><p><strong>len</strong> -- the number of bytes to checksum </p></li>
<li><p><strong>chunk_size</strong> -- optional length-aligned chunk size for checksums </p></li>
<li><p><strong>pchecksum</strong> -- where to store the checksum result for this action </p></li>
<li><p><strong>checksum_len</strong> -- the number of bytes available for the result </p></li>
<li><p><strong>prval</strong> -- where to store the return value for this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_exec">
<span class="target" id="librados_8h_1a85addfa555234a15691b9f0d004c6b6c"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_exec</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cls</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">method</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">in_buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">in_len</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">out_buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">out_len</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_exec" title="Permalink to this definition"></a><br /></dt>
<dd><p>Execute an OSD class method on an object See rados_exec() for general description.</p>
<p>The output buffer is allocated on the heap; the caller is expected to release that memory with rados_buffer_free(). The buffer and length pointers can all be NULL, in which case they are not filled in.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>cls</strong> -- the name of the class </p></li>
<li><p><strong>method</strong> -- the name of the method </p></li>
<li><p><strong>in_buf</strong> -- where to find input </p></li>
<li><p><strong>in_len</strong> -- length of in_buf in bytes </p></li>
<li><p><strong>out_buf</strong> -- where to put librados-allocated output buffer </p></li>
<li><p><strong>out_len</strong> -- length of out_buf in bytes </p></li>
<li><p><strong>prval</strong> -- where to store the return value from the method </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_exec_user_buf">
<span class="target" id="librados_8h_1a288dd1b6fb55287cd7c8e0cf96dc228e"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_exec_user_buf</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cls</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">method</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">in_buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">in_len</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">out_buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">out_len</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">used_len</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_exec_user_buf" title="Permalink to this definition"></a><br /></dt>
<dd><p>Execute an OSD class method on an object See rados_exec() for general description.</p>
<p>If the output buffer is too small, prval will be set to -ERANGE and used_len will be 0.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>cls</strong> -- the name of the class </p></li>
<li><p><strong>method</strong> -- the name of the method </p></li>
<li><p><strong>in_buf</strong> -- where to find input </p></li>
<li><p><strong>in_len</strong> -- length of in_buf in bytes </p></li>
<li><p><strong>out_buf</strong> -- user-provided buffer to read into </p></li>
<li><p><strong>out_len</strong> -- length of out_buf in bytes </p></li>
<li><p><strong>used_len</strong> -- where to store the number of bytes read into out_buf </p></li>
<li><p><strong>prval</strong> -- where to store the return value from the method </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_omap_get_vals">
<span class="target" id="librados_8h_1aaa83fb15362c9b0732fcd6dfda8f23ff"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_omap_get_vals</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">start_after</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">filter_prefix</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">max_return</span></span>, <a class="reference internal" href="#c.rados_omap_iter_t" title="rados_omap_iter_t"><span class="n"><span class="pre">rados_omap_iter_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">iter</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_read_op_omap_get_vals" title="Permalink to this definition"></a><br /></dt>
<dd><p>Start iterating over key/value pairs on an object.</p>
<p>They will be returned sorted by key.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>start_after</strong> -- list keys starting after start_after </p></li>
<li><p><strong>filter_prefix</strong> -- list only keys beginning with filter_prefix </p></li>
<li><p><strong>max_return</strong> -- list no more than max_return key/value pairs </p></li>
<li><p><strong>iter</strong> -- where to store the iterator </p></li>
<li><p><strong>prval</strong> -- where to store the return value from this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_omap_get_vals2">
<span class="target" id="librados_8h_1a1ce63c13f33c2baf1b5b273e4f38cac5"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_omap_get_vals2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">start_after</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">filter_prefix</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">max_return</span></span>, <a class="reference internal" href="#c.rados_omap_iter_t" title="rados_omap_iter_t"><span class="n"><span class="pre">rados_omap_iter_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">iter</span></span>, <span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pmore</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_omap_get_vals2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Start iterating over key/value pairs on an object.</p>
<p>They will be returned sorted by key.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>start_after</strong> -- list keys starting after start_after </p></li>
<li><p><strong>filter_prefix</strong> -- list only keys beginning with filter_prefix </p></li>
<li><p><strong>max_return</strong> -- list no more than max_return key/value pairs </p></li>
<li><p><strong>iter</strong> -- where to store the iterator </p></li>
<li><p><strong>pmore</strong> -- flag indicating whether there are more keys to fetch </p></li>
<li><p><strong>prval</strong> -- where to store the return value from this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_omap_get_keys">
<span class="target" id="librados_8h_1a75b62b2df2cfad634cbe7f5e6472c5a2"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_omap_get_keys</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">start_after</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">max_return</span></span>, <a class="reference internal" href="#c.rados_omap_iter_t" title="rados_omap_iter_t"><span class="n"><span class="pre">rados_omap_iter_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">iter</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_read_op_omap_get_keys" title="Permalink to this definition"></a><br /></dt>
<dd><p>Start iterating over keys on an object.</p>
<p>They will be returned sorted by key, and the iterator will fill in NULL for all values if specified.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>start_after</strong> -- list keys starting after start_after </p></li>
<li><p><strong>max_return</strong> -- list no more than max_return keys </p></li>
<li><p><strong>iter</strong> -- where to store the iterator </p></li>
<li><p><strong>prval</strong> -- where to store the return value from this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_omap_get_keys2">
<span class="target" id="librados_8h_1a90a738595cfab913a43a4aadd166db39"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_omap_get_keys2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">start_after</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n"><span class="pre">max_return</span></span>, <a class="reference internal" href="#c.rados_omap_iter_t" title="rados_omap_iter_t"><span class="n"><span class="pre">rados_omap_iter_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">iter</span></span>, <span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pmore</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_omap_get_keys2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Start iterating over keys on an object.</p>
<p>They will be returned sorted by key, and the iterator will fill in NULL for all values if specified.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>start_after</strong> -- list keys starting after start_after </p></li>
<li><p><strong>max_return</strong> -- list no more than max_return keys </p></li>
<li><p><strong>iter</strong> -- where to store the iterator </p></li>
<li><p><strong>pmore</strong> -- flag indicating whether there are more keys to fetch </p></li>
<li><p><strong>prval</strong> -- where to store the return value from this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_omap_get_vals_by_keys">
<span class="target" id="librados_8h_1ad1ac003b47d626a3492c33cd7d34c6ec"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_omap_get_vals_by_keys</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">keys</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">keys_len</span></span>, <a class="reference internal" href="#c.rados_omap_iter_t" title="rados_omap_iter_t"><span class="n"><span class="pre">rados_omap_iter_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">iter</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_omap_get_vals_by_keys" title="Permalink to this definition"></a><br /></dt>
<dd><p>Start iterating over specific key/value pairs</p>
<p>They will be returned sorted by key.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>keys</strong> -- array of pointers to null-terminated keys to get </p></li>
<li><p><strong>keys_len</strong> -- the number of strings in keys </p></li>
<li><p><strong>iter</strong> -- where to store the iterator </p></li>
<li><p><strong>prval</strong> -- where to store the return value from this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_omap_get_vals_by_keys2">
<span class="target" id="librados_8h_1ac5c58e84b9cc0c0a8eb982e640e589be"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_omap_get_vals_by_keys2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">keys</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">num_keys</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key_lens</span></span>, <a class="reference internal" href="#c.rados_omap_iter_t" title="rados_omap_iter_t"><span class="n"><span class="pre">rados_omap_iter_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">iter</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">prval</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_omap_get_vals_by_keys2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Start iterating over specific key/value pairs</p>
<p>They will be returned sorted by key.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to add this action to </p></li>
<li><p><strong>keys</strong> -- array of pointers to keys to get </p></li>
<li><p><strong>num_keys</strong> -- the number of strings in keys </p></li>
<li><p><strong>key_lens</strong> -- array of size_t’s describing each key len (in bytes) </p></li>
<li><p><strong>iter</strong> -- where to store the iterator </p></li>
<li><p><strong>prval</strong> -- where to store the return value from this action </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_read_op_operate">
<span class="target" id="librados_8h_1a359b8b3d325cd18d3a9ac1d245e104ec"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_operate</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_read_op_operate" title="Permalink to this definition"></a><br /></dt>
<dd><p>Perform a read operation synchronously </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to perform </p></li>
<li><p><strong>io</strong> -- the ioctx that the object is in </p></li>
<li><p><strong>oid</strong> -- the object id </p></li>
<li><p><strong>flags</strong> -- flags to apply to the entire operation (LIBRADOS_OPERATION_*) </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_read_op_operate">
<span class="target" id="librados_8h_1ac2ef3096bcf0b66a5cfec4dff6f446f3"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_read_op_operate</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_read_op_t" title="rados_read_op_t"><span class="n"><span class="pre">rados_read_op_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">read_op</span></span>, <a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_read_op_operate" title="Permalink to this definition"></a><br /></dt>
<dd><p>Perform a read operation asynchronously </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>read_op</strong> -- operation to perform </p></li>
<li><p><strong>io</strong> -- the ioctx that the object is in </p></li>
<li><p><strong>completion</strong> -- what to do when operation has been attempted </p></li>
<li><p><strong>oid</strong> -- the object id </p></li>
<li><p><strong>flags</strong> -- flags to apply to the entire operation (LIBRADOS_OPERATION_*) </p></li>
</ul>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-defines">Defines</p>
<dl class="c macro">
<dt class="sig sig-object c" id="c.CEPH_OSD_TMAP_HDR">
<span class="target" id="librados_8h_1a7374c886c3d189e22dab99e8e97b1c4a"></span><span class="sig-name descname"><span class="n"><span class="pre">CEPH_OSD_TMAP_HDR</span></span></span><a class="headerlink" href="#c.CEPH_OSD_TMAP_HDR" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.CEPH_OSD_TMAP_SET">
<span class="target" id="librados_8h_1ada41defa6d369f2e04ca53fc40754a37"></span><span class="sig-name descname"><span class="n"><span class="pre">CEPH_OSD_TMAP_SET</span></span></span><a class="headerlink" href="#c.CEPH_OSD_TMAP_SET" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.CEPH_OSD_TMAP_CREATE">
<span class="target" id="librados_8h_1a0ba9335b21cd46e0cb4b03bf972f73e9"></span><span class="sig-name descname"><span class="n"><span class="pre">CEPH_OSD_TMAP_CREATE</span></span></span><a class="headerlink" href="#c.CEPH_OSD_TMAP_CREATE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.CEPH_OSD_TMAP_RM">
<span class="target" id="librados_8h_1a553821d1fdb398b952d8595b2ea7939a"></span><span class="sig-name descname"><span class="n"><span class="pre">CEPH_OSD_TMAP_RM</span></span></span><a class="headerlink" href="#c.CEPH_OSD_TMAP_RM" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_VER_MAJOR">
<span class="target" id="librados_8h_1a0e0a428e7c02e984c30aaf54631b9179"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_VER_MAJOR</span></span></span><a class="headerlink" href="#c.LIBRADOS_VER_MAJOR" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_VER_MINOR">
<span class="target" id="librados_8h_1a6921c0c5fa48340c3b43d986b924789d"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_VER_MINOR</span></span></span><a class="headerlink" href="#c.LIBRADOS_VER_MINOR" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_VER_EXTRA">
<span class="target" id="librados_8h_1a1365154562de601650c9195216f47597"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_VER_EXTRA</span></span></span><a class="headerlink" href="#c.LIBRADOS_VER_EXTRA" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_VERSION">
<span class="target" id="librados_8h_1a6a37ef77a4f8ab9670d137329fd9ec3d"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_VERSION</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">maj</span></span>, <span class="n"><span class="pre">min</span></span>, <span class="n"><span class="pre">extra</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.LIBRADOS_VERSION" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_VERSION_CODE">
<span class="target" id="librados_8h_1a5931a8379cebc7eed36f7146cfa1afa2"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_VERSION_CODE</span></span></span><a class="headerlink" href="#c.LIBRADOS_VERSION_CODE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_SUPPORTS_WATCH">
<span class="target" id="librados_8h_1a49279ff58e94fe7bc89cf2a9561abc49"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_SUPPORTS_WATCH</span></span></span><a class="headerlink" href="#c.LIBRADOS_SUPPORTS_WATCH" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_SUPPORTS_SERVICES">
<span class="target" id="librados_8h_1ab9cf1e9c7fc1883e66fbbd9724c434bf"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_SUPPORTS_SERVICES</span></span></span><a class="headerlink" href="#c.LIBRADOS_SUPPORTS_SERVICES" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_SUPPORTS_GETADDRS">
<span class="target" id="librados_8h_1a178e54aa2afa079c6751525e25c35fa7"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_SUPPORTS_GETADDRS</span></span></span><a class="headerlink" href="#c.LIBRADOS_SUPPORTS_GETADDRS" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_SUPPORTS_APP_METADATA">
<span class="target" id="librados_8h_1a85878e8cecc477e2f160a7378542851c"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_SUPPORTS_APP_METADATA</span></span></span><a class="headerlink" href="#c.LIBRADOS_SUPPORTS_APP_METADATA" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_LOCK_FLAG_RENEW">
<span class="target" id="librados_8h_1a8422e60e2574925bf18537aac98fff00"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_LOCK_FLAG_RENEW</span></span></span><a class="headerlink" href="#c.LIBRADOS_LOCK_FLAG_RENEW" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_LOCK_FLAG_MAY_RENEW">
<span class="target" id="librados_8h_1a68adc8435687d14854191fe17be6ac29"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_LOCK_FLAG_MAY_RENEW</span></span></span><a class="headerlink" href="#c.LIBRADOS_LOCK_FLAG_MAY_RENEW" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_LOCK_FLAG_MUST_RENEW">
<span class="target" id="librados_8h_1a0e89790cffc9c2457783de9d10cd2d4a"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_LOCK_FLAG_MUST_RENEW</span></span></span><a class="headerlink" href="#c.LIBRADOS_LOCK_FLAG_MUST_RENEW" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_CREATE_EXCLUSIVE">
<span class="target" id="librados_8h_1ac1f2fb141026970b30b31c6b510c40ec"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_CREATE_EXCLUSIVE</span></span></span><a class="headerlink" href="#c.LIBRADOS_CREATE_EXCLUSIVE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_CREATE_IDEMPOTENT">
<span class="target" id="librados_8h_1a9d95de9eadd0c19d2d882207f68cd087"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_CREATE_IDEMPOTENT</span></span></span><a class="headerlink" href="#c.LIBRADOS_CREATE_IDEMPOTENT" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.CEPH_RADOS_API">
<span class="target" id="librados_8h_1aafc8385a5a2f57cee390b248a5edb1ee"></span><span class="sig-name descname"><span class="n"><span class="pre">CEPH_RADOS_API</span></span></span><a class="headerlink" href="#c.CEPH_RADOS_API" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_SNAP_HEAD">
<span class="target" id="librados_8h_1a4f7b1b8bdc639f1bc8d66327d53977bd"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_SNAP_HEAD</span></span></span><a class="headerlink" href="#c.LIBRADOS_SNAP_HEAD" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.LIBRADOS_SNAP_DIR">
<span class="target" id="librados_8h_1a94024e58d58fb0a06c184e5b1e725ccd"></span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_SNAP_DIR</span></span></span><a class="headerlink" href="#c.LIBRADOS_SNAP_DIR" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.VOIDPTR_RADOS_T">
<span class="target" id="librados_8h_1a1719ba6b7d7d1c354174867d5433fb11"></span><span class="sig-name descname"><span class="n"><span class="pre">VOIDPTR_RADOS_T</span></span></span><a class="headerlink" href="#c.VOIDPTR_RADOS_T" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-typedefs">Typedefs</p>
<dl class="c type">
<dt class="sig sig-object c" id="c.rados_t">
<span class="target" id="librados_8h_1a3aec0ef5f5b39a22a7d210ff701814de"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_t</span></span></span><a class="headerlink" href="#c.rados_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>A handle for interacting with a RADOS cluster. It encapsulates all RADOS client configuration, including username, key for authentication, logging, and debugging. Talking to different clusters &amp;#8212; or to the same cluster with different users &amp;#8212; requires different cluster handles. </p>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_config_t">
<span class="target" id="librados_8h_1ab9b166c127d67cd6a2795e21f70c23e1"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_config_t</span></span></span><a class="headerlink" href="#c.rados_config_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>A handle for the ceph configuration context for the rados_t cluster instance. This can be used to share configuration context/state (e.g., logging configuration) between librados instance.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The config context does not have independent reference counting. As such, a rados_config_t handle retrieved from a given rados_t is only valid as long as that rados_t. </p>
</div>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_ioctx_t">
<span class="target" id="librados_8h_1abee75dec49ad9f858ab7c498539c6162"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_ioctx_t</span></span></span><a class="headerlink" href="#c.rados_ioctx_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>An io context encapsulates a few settings for all I/O operations done on it:<ul class="simple">
<li><p>pool - set when the io context is created (see rados_ioctx_create())</p></li>
<li><p>snapshot context for writes (see rados_ioctx_selfmanaged_snap_set_write_ctx())</p></li>
<li><p>snapshot id to read from (see rados_ioctx_snap_set_read())</p></li>
<li><p>object locator for all single-object operations (see rados_ioctx_locator_set_key())</p></li>
<li><p>namespace for all single-object operations (see rados_ioctx_set_namespace()). Set to LIBRADOS_ALL_NSPACES before rados_nobjects_list_open() will list all objects in all namespaces.</p></li>
</ul>
</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Changing any of these settings is not thread-safe - librados users must synchronize any of these changes on their own, or use separate io contexts for each thread </p>
</div>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_list_ctx_t">
<span class="target" id="librados_8h_1a90e7efb90fa2074b2491406879abcf71"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_list_ctx_t</span></span></span><a class="headerlink" href="#c.rados_list_ctx_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>An iterator for listing the objects in a pool. Used with rados_nobjects_list_open(), rados_nobjects_list_next(), rados_nobjects_list_next2(), and rados_nobjects_list_close(). </p>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_object_list_cursor">
<span class="target" id="librados_8h_1a2426d8ce671e2d1298730ed9345d9529"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_object_list_cursor</span></span></span><a class="headerlink" href="#c.rados_object_list_cursor" title="Permalink to this definition"></a><br /></dt>
<dd><p>The cursor used with rados_enumerate_objects and accompanying methods. </p>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_snap_t">
<span class="target" id="librados_8h_1a855819068ff6464aaa9208f6abcd0b42"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_snap_t</span></span></span><a class="headerlink" href="#c.rados_snap_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>The id of a snapshot. </p>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_xattrs_iter_t">
<span class="target" id="librados_8h_1a6eead837fa8fd45d77d39f6912f4a9ad"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_xattrs_iter_t</span></span></span><a class="headerlink" href="#c.rados_xattrs_iter_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>An iterator for listing extended attrbutes on an object. Used with rados_getxattrs(), rados_getxattrs_next(), and rados_getxattrs_end(). </p>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_omap_iter_t">
<span class="target" id="librados_8h_1aa5f51192c245bb4e295275a56a74c98c"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_omap_iter_t</span></span></span><a class="headerlink" href="#c.rados_omap_iter_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>An iterator for listing omap key/value pairs on an object. Used with rados_read_op_omap_get_keys(), rados_read_op_omap_get_vals(), rados_read_op_omap_get_vals_by_keys(), rados_omap_get_next(), and rados_omap_get_end(). </p>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_write_op_t">
<span class="target" id="librados_8h_1aa587d73fc92a6147425feb8fb791bfbd"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_write_op_t</span></span></span><a class="headerlink" href="#c.rados_write_op_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>An object write operation stores a number of operations which can be executed atomically. For usage, see:<ul class="simple">
<li><p>Creation and deletion: rados_create_write_op() rados_release_write_op()</p></li>
<li><p>Extended attribute manipulation: rados_write_op_cmpxattr() rados_write_op_cmpxattr(), rados_write_op_setxattr(), rados_write_op_rmxattr()</p></li>
<li><p>Object map key/value pairs: rados_write_op_omap_set(), rados_write_op_omap_rm_keys(), rados_write_op_omap_clear(), rados_write_op_omap_cmp()</p></li>
<li><p>Object properties: rados_write_op_assert_exists(), rados_write_op_assert_version()</p></li>
<li><p>Creating objects: rados_write_op_create()</p></li>
<li><p>IO on objects: rados_write_op_append(), rados_write_op_write(), rados_write_op_zero rados_write_op_write_full(), rados_write_op_writesame(), rados_write_op_remove, rados_write_op_truncate(), rados_write_op_zero(), rados_write_op_cmpext()</p></li>
<li><p>Hints: rados_write_op_set_alloc_hint()</p></li>
<li><p>Performing the operation: rados_write_op_operate(), rados_aio_write_op_operate() </p></li>
</ul>
</p>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_read_op_t">
<span class="target" id="librados_8h_1a47a71dce77b47c83737f5f9ff3a750ce"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_read_op_t</span></span></span><a class="headerlink" href="#c.rados_read_op_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>An object read operation stores a number of operations which can be executed atomically. For usage, see:<ul class="simple">
<li><p>Creation and deletion: rados_create_read_op() rados_release_read_op()</p></li>
<li><p>Extended attribute manipulation: rados_read_op_cmpxattr(), rados_read_op_getxattr(), rados_read_op_getxattrs()</p></li>
<li><p>Object map key/value pairs: rados_read_op_omap_get_vals(), rados_read_op_omap_get_keys(), rados_read_op_omap_get_vals_by_keys(), rados_read_op_omap_cmp()</p></li>
<li><p>Object properties: rados_read_op_stat(), rados_read_op_assert_exists(), rados_read_op_assert_version()</p></li>
<li><p>IO on objects: rados_read_op_read(), rados_read_op_checksum(), rados_read_op_cmpext()</p></li>
<li><p>Custom operations: rados_read_op_exec(), rados_read_op_exec_user_buf()</p></li>
<li><p>Request properties: rados_read_op_set_flags()</p></li>
<li><p>Performing the operation: rados_read_op_operate(), rados_aio_read_op_operate() </p></li>
</ul>
</p>
</dd></dl>

<dl class="c type">
<dt class="sig sig-object c" id="c.rados_completion_t">
<span class="target" id="librados_8h_1a4c575eb7fcff2f980d1d9408ff4f33d9"></span><span class="k"><span class="pre">typedef</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">rados_completion_t</span></span></span><a class="headerlink" href="#c.rados_completion_t" title="Permalink to this definition"></a><br /></dt>
<dd><p>Represents the state of an asynchronous operation - it contains the return value once the operation completes, and can be used to block until the operation is complete or safe. </p>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-enums">Enums</p>
<dl class="c enum">
<dt class="sig sig-object c">
<span class="target" id="librados_8h_1a41cb9333f5fe169e7d9275fd1da9d713"></span><span class="sig-name descname"></span></dt>
<dd><p><em>Values:</em></p>
<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OP_FLAG_EXCL">
<span class="target" id="librados_8h_1a41cb9333f5fe169e7d9275fd1da9d713aff6ea20a1a925a1498302cad07b4ff52"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OP_FLAG_EXCL</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OP_FLAG_EXCL" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FAILOK">
<span class="target" id="librados_8h_1a41cb9333f5fe169e7d9275fd1da9d713a2c73bded10de4b1a8754a89e7ae93887"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OP_FLAG_FAILOK</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FAILOK" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_RANDOM">
<span class="target" id="librados_8h_1a41cb9333f5fe169e7d9275fd1da9d713ab5be2a94eb79badadc9456c45d6f1841"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OP_FLAG_FADVISE_RANDOM</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_RANDOM" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL">
<span class="target" id="librados_8h_1a41cb9333f5fe169e7d9275fd1da9d713a0c8c16bf2b135b5bf519389ed4b79742"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_WILLNEED">
<span class="target" id="librados_8h_1a41cb9333f5fe169e7d9275fd1da9d713a1b93fe7705f5b03384def1ad43b73a86"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OP_FLAG_FADVISE_WILLNEED</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_WILLNEED" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_DONTNEED">
<span class="target" id="librados_8h_1a41cb9333f5fe169e7d9275fd1da9d713a75277c9bba643f4dfcd629549c7aeff7"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OP_FLAG_FADVISE_DONTNEED</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_DONTNEED" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_NOCACHE">
<span class="target" id="librados_8h_1a41cb9333f5fe169e7d9275fd1da9d713a6701f8ce0bcc4db4e36f1f744bc2751b"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OP_FLAG_FADVISE_NOCACHE</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_NOCACHE" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_FUA">
<span class="target" id="librados_8h_1a41cb9333f5fe169e7d9275fd1da9d713a2760dc2f6d1a690c3fb4f72046a3cd50"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_OP_FLAG_FADVISE_FUA</span></span></span><a class="headerlink" href="#c.PhonyNameDueToError.LIBRADOS_OP_FLAG_FADVISE_FUA" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

</dd></dl>

<dl class="c enum">
<dt class="sig sig-object c" id="c.rados_checksum_type_t">
<span class="target" id="librados_8h_1a21d5ea2e2efa6a927e446514178318da"></span><span class="k"><span class="pre">enum</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_checksum_type_t</span></span></span><a class="headerlink" href="#c.rados_checksum_type_t" title="Permalink to this definition"></a><br /></dt>
<dd><p><em>Values:</em></p>
<dl class="c enumerator">
<dt class="sig sig-object c" id="c.rados_checksum_type_t.LIBRADOS_CHECKSUM_TYPE_XXHASH32">
<span class="target" id="librados_8h_1a21d5ea2e2efa6a927e446514178318daa72537a490295370ecaa487f9ff0311e7"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_CHECKSUM_TYPE_XXHASH32</span></span></span><a class="headerlink" href="#c.rados_checksum_type_t.LIBRADOS_CHECKSUM_TYPE_XXHASH32" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.rados_checksum_type_t.LIBRADOS_CHECKSUM_TYPE_XXHASH64">
<span class="target" id="librados_8h_1a21d5ea2e2efa6a927e446514178318daa52ec18ad685189812518893f4da1b74a"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_CHECKSUM_TYPE_XXHASH64</span></span></span><a class="headerlink" href="#c.rados_checksum_type_t.LIBRADOS_CHECKSUM_TYPE_XXHASH64" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c enumerator">
<dt class="sig sig-object c" id="c.rados_checksum_type_t.LIBRADOS_CHECKSUM_TYPE_CRC32C">
<span class="target" id="librados_8h_1a21d5ea2e2efa6a927e446514178318daac161c13163b636a2b5b864bfc13f18e0"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LIBRADOS_CHECKSUM_TYPE_CRC32C</span></span></span><a class="headerlink" href="#c.rados_checksum_type_t.LIBRADOS_CHECKSUM_TYPE_CRC32C" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-functions">Functions</p>
<dl class="c function">
<dt class="sig sig-object c" id="c.rados_version">
<span class="target" id="librados_8h_1a7c24473098a6b78fa7db64ddd9b5c99e"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_version</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">major</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">minor</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">extra</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_version" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the version of librados.</p>
<p>The version number is major.minor.extra. Note that this is unrelated to the Ceph version number.</p>
<p>TODO: define version semantics, i.e.:<ul class="simple">
<li><p>incrementing major is for backwards-incompatible changes</p></li>
<li><p>incrementing minor is for backwards-compatible changes</p></li>
<li><p>incrementing extra is for bug fixes</p></li>
</ul>
</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>major</strong> -- where to store the major version number </p></li>
<li><p><strong>minor</strong> -- where to store the minor version number </p></li>
<li><p><strong>extra</strong> -- where to store the extra version number </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_cluster_stat">
<span class="target" id="librados_8h_1a54bad6e580743a0b337f5c4b11a6db51"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_cluster_stat</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><a class="reference internal" href="#c.rados_cluster_stat_t" title="rados_cluster_stat_t"><span class="n"><span class="pre">rados_cluster_stat_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">result</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_cluster_stat" title="Permalink to this definition"></a><br /></dt>
<dd><p>Read usage info about the cluster</p>
<p>This tells you total space, space used, space available, and number of objects. These are not updated immediately when data is written, they are eventually consistent.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster to query </p></li>
<li><p><strong>result</strong> -- where to store the results </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_cluster_fsid">
<span class="target" id="librados_8h_1a47c87732b80054bbd91b3293e1c5726c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_cluster_fsid</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_cluster_fsid" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the fsid of the cluster as a hexadecimal string.</p>
<p>The fsid is a unique id of an entire Ceph cluster.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- where to get the fsid </p></li>
<li><p><strong>buf</strong> -- where to write the fsid </p></li>
<li><p><strong>len</strong> -- the size of buf in bytes (should be 37) </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ERANGE if the buffer is too short to contain the fsid </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_wait_for_latest_osdmap">
<span class="target" id="librados_8h_1a7f42767c8cbd06aaa208a3f259946c87"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_wait_for_latest_osdmap</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_wait_for_latest_osdmap" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get/wait for the most recent osdmap</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- the cluster to shutdown </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_omap_get_next">
<span class="target" id="librados_8h_1af87c8ae7ba9c45553ea57b4132be2b91"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_omap_get_next</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_omap_iter_t" title="rados_omap_iter_t"><span class="n"><span class="pre">rados_omap_iter_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">iter</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_omap_get_next" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the next omap key/value pair on the object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>iter</strong> -- iterator to advance </p></li>
<li><p><strong>key</strong> -- where to store the key of the next omap entry </p></li>
<li><p><strong>val</strong> -- where to store the value of the next omap entry </p></li>
<li><p><strong>len</strong> -- where to store the number of bytes in val </p></li>
</ul>
</dd>
<dt class="field-even">Pre<span class="colon">:</span></dt>
<dd class="field-even"><p>iter is a valid iterator</p>
</dd>
<dt class="field-odd">Post<span class="colon">:</span></dt>
<dd class="field-odd"><p>key and val are the next key/value pair. key is null-terminated, and val has length len. If the end of the list has been reached, key and val are NULL, and len is 0. key and val will not be accessible after rados_omap_get_end() is called on iter, so if they are needed after that they should be copied.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_omap_get_next2">
<span class="target" id="librados_8h_1a2df681b5cc0a2a50ecf7a6da77e67d0c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_omap_get_next2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_omap_iter_t" title="rados_omap_iter_t"><span class="n"><span class="pre">rados_omap_iter_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">iter</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key_len</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_omap_get_next2" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get the next omap key/value pair on the object. Note that it’s perfectly safe to mix calls to rados_omap_get_next and rados_omap_get_next2.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>iter</strong> -- iterator to advance </p></li>
<li><p><strong>key</strong> -- where to store the key of the next omap entry </p></li>
<li><p><strong>val</strong> -- where to store the value of the next omap entry </p></li>
<li><p><strong>key_len</strong> -- where to store the number of bytes in key </p></li>
<li><p><strong>val_len</strong> -- where to store the number of bytes in val </p></li>
</ul>
</dd>
<dt class="field-even">Pre<span class="colon">:</span></dt>
<dd class="field-even"><p>iter is a valid iterator</p>
</dd>
<dt class="field-odd">Post<span class="colon">:</span></dt>
<dd class="field-odd"><p>key and val are the next key/value pair. key has length keylen and val has length vallen. If the end of the list has been reached, key and val are NULL, and keylen and vallen is 0. key and val will not be accessible after rados_omap_get_end() is called on iter, so if they are needed after that they should be copied.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_omap_iter_size">
<span class="target" id="librados_8h_1abc4442cb4ca36a6f3b36f155f210127c"></span><span class="kt"><span class="pre">unsigned</span></span><span class="w"> </span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_omap_iter_size</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_omap_iter_t" title="rados_omap_iter_t"><span class="n"><span class="pre">rados_omap_iter_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">iter</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_omap_iter_size" title="Permalink to this definition"></a><br /></dt>
<dd><p>Return number of elements in the iterator</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>iter</strong> -- the iterator of which to return the size </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_omap_get_end">
<span class="target" id="librados_8h_1aab65e5b00f3787984ebc9fe0f0341d80"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_omap_get_end</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_omap_iter_t" title="rados_omap_iter_t"><span class="n"><span class="pre">rados_omap_iter_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">iter</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_omap_get_end" title="Permalink to this definition"></a><br /></dt>
<dd><p>Close the omap iterator.</p>
<p>iter should not be used after this is called.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>iter</strong> -- the iterator to close </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_stat">
<span class="target" id="librados_8h_1ab38f37f6331e62b8b6c1154785a2c2dc"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_stat</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">psize</span></span>, <span class="n"><span class="pre">time_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pmtime</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_stat" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get object size and most recent update time from the OSD.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- ioctx </p></li>
<li><p><strong>o</strong> -- object name </p></li>
<li><p><strong>psize</strong> -- where to store object size </p></li>
<li><p><strong>pmtime</strong> -- where to store modification time </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_stat2">
<span class="target" id="librados_8h_1a757e5f10b92eec9d21d8487bb3a06b06"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_stat2</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">psize</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">timespec</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pmtime</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_stat2" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_exec">
<span class="target" id="librados_8h_1a0e181ac0d75ee84d8b09bd090f91cc82"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_exec</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cls</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">method</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">in_buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">in_len</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">out_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_exec" title="Permalink to this definition"></a><br /></dt>
<dd><p>Execute an OSD class method on an object</p>
<p>The OSD has a plugin mechanism for performing complicated operations on an object atomically. These plugins are called classes. This function allows librados users to call the custom methods. The input and output formats are defined by the class. Classes in ceph.git can be found in src/cls subdirectories</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context in which to call the method </p></li>
<li><p><strong>oid</strong> -- the object to call the method on </p></li>
<li><p><strong>cls</strong> -- the name of the class </p></li>
<li><p><strong>method</strong> -- the name of the method </p></li>
<li><p><strong>in_buf</strong> -- where to find input </p></li>
<li><p><strong>in_len</strong> -- length of in_buf in bytes </p></li>
<li><p><strong>buf</strong> -- where to store output </p></li>
<li><p><strong>out_len</strong> -- length of buf in bytes </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the length of the output, or -ERANGE if out_buf does not have enough space to store it (For methods that return data). For methods that don’t return data, the return value is method-specific. </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_cache_pin">
<span class="target" id="librados_8h_1a39ee22edd8e077b498a26824ac1fe4c9"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_cache_pin</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_cache_pin" title="Permalink to this definition"></a><br /></dt>
<dd><p>Pin an object in the cache tier</p>
<p>When an object is pinned in the cache tier, it stays in the cache tier, and won’t be flushed out.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the object id </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_cache_unpin">
<span class="target" id="librados_8h_1aa9883df14ff92869b095be384bcb03b5"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_cache_unpin</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_cache_unpin" title="Permalink to this definition"></a><br /></dt>
<dd><p>Unpin an object in the cache tier</p>
<p>After an object is unpinned in the cache tier, it can be flushed out</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the pool the object is in </p></li>
<li><p><strong>o</strong> -- the object id </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_lock_exclusive">
<span class="target" id="librados_8h_1afead444ccfa2c479fefc606ea2e43daa"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_lock_exclusive</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">oid</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cookie</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">desc</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">timeval</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">duration</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_lock_exclusive" title="Permalink to this definition"></a><br /></dt>
<dd><p>Take an exclusive lock on an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context to operate in </p></li>
<li><p><strong>oid</strong> -- the name of the object </p></li>
<li><p><strong>name</strong> -- the name of the lock </p></li>
<li><p><strong>cookie</strong> -- user-defined identifier for this instance of the lock </p></li>
<li><p><strong>desc</strong> -- user-defined lock description </p></li>
<li><p><strong>duration</strong> -- the duration of the lock. Set to NULL for infinite duration. </p></li>
<li><p><strong>flags</strong> -- lock flags </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-EBUSY if the lock is already held by another (client, cookie) pair </p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>-EEXIST if the lock is already held by the same (client, cookie) pair </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_lock_shared">
<span class="target" id="librados_8h_1aca33e59ebbfd1fd13c4b7ce4517c08c2"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_lock_shared</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cookie</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">tag</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">desc</span></span>, <span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="n"><span class="pre">timeval</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">duration</span></span>, <span class="n"><span class="pre">uint8_t</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_lock_shared" title="Permalink to this definition"></a><br /></dt>
<dd><p>Take a shared lock on an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context to operate in </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>name</strong> -- the name of the lock </p></li>
<li><p><strong>cookie</strong> -- user-defined identifier for this instance of the lock </p></li>
<li><p><strong>tag</strong> -- The tag of the lock </p></li>
<li><p><strong>desc</strong> -- user-defined lock description </p></li>
<li><p><strong>duration</strong> -- the duration of the lock. Set to NULL for infinite duration. </p></li>
<li><p><strong>flags</strong> -- lock flags </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-EBUSY if the lock is already held by another (client, cookie) pair </p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>-EEXIST if the lock is already held by the same (client, cookie) pair </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_unlock">
<span class="target" id="librados_8h_1a29ba6573aa7eb6b683e72c653e929951"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_unlock</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cookie</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_unlock" title="Permalink to this definition"></a><br /></dt>
<dd><p>Release a shared or exclusive lock on an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context to operate in </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>name</strong> -- the name of the lock </p></li>
<li><p><strong>cookie</strong> -- user-defined identifier for the instance of the lock </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ENOENT if the lock is not held by the specified (client, cookie) pair </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_aio_unlock">
<span class="target" id="librados_8h_1a827435e97406ca01bf3750b09683c882"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_aio_unlock</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cookie</span></span>, <a class="reference internal" href="#c.rados_completion_t" title="rados_completion_t"><span class="n"><span class="pre">rados_completion_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">completion</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_aio_unlock" title="Permalink to this definition"></a><br /></dt>
<dd><p>Asynchronous release a shared or exclusive lock on an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context to operate in </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>name</strong> -- the name of the lock </p></li>
<li><p><strong>cookie</strong> -- user-defined identifier for the instance of the lock </p></li>
<li><p><strong>completion</strong> -- what to do when operation has been attempted </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_list_lockers">
<span class="target" id="librados_8h_1a73d3cc66d6ce43a41f6e9144e5c9c0af"></span><span class="n"><span class="pre">ssize_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_list_lockers</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">exclusive</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">tag</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">tag_len</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">clients</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">clients_len</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cookies</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cookies_len</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">addrs</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">addrs_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_list_lockers" title="Permalink to this definition"></a><br /></dt>
<dd><p>List clients that have locked the named object lock and information about the lock.</p>
<p>The number of bytes required in each buffer is put in the corresponding size out parameter. If any of the provided buffers are too short, -ERANGE is returned after these sizes are filled in.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context to operate in </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>name</strong> -- the name of the lock </p></li>
<li><p><strong>exclusive</strong> -- where to store whether the lock is exclusive (1) or shared (0) </p></li>
<li><p><strong>tag</strong> -- where to store the tag associated with the object lock </p></li>
<li><p><strong>tag_len</strong> -- number of bytes in tag buffer </p></li>
<li><p><strong>clients</strong> -- buffer in which locker clients are stored, separated by ‘\0’ </p></li>
<li><p><strong>clients_len</strong> -- number of bytes in the clients buffer </p></li>
<li><p><strong>cookies</strong> -- buffer in which locker cookies are stored, separated by ‘\0’ </p></li>
<li><p><strong>cookies_len</strong> -- number of bytes in the cookies buffer </p></li>
<li><p><strong>addrs</strong> -- buffer in which locker addresses are stored, separated by ‘\0’ </p></li>
<li><p><strong>addrs_len</strong> -- number of bytes in the clients buffer </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>number of lockers on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ERANGE if any of the buffers are too short </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_break_lock">
<span class="target" id="librados_8h_1af12f44398df2cbccfea25331e4d06aca"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_break_lock</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">cookie</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_break_lock" title="Permalink to this definition"></a><br /></dt>
<dd><p>Releases a shared or exclusive lock on an object, which was taken by the specified client.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- the context to operate in </p></li>
<li><p><strong>o</strong> -- the name of the object </p></li>
<li><p><strong>name</strong> -- the name of the lock </p></li>
<li><p><strong>client</strong> -- the client currently holding the lock </p></li>
<li><p><strong>cookie</strong> -- user-defined identifier for the instance of the lock </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ENOENT if the lock is not held by the specified (client, cookie) pair </p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>-EINVAL if the client cannot be parsed </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_blocklist_add">
<span class="target" id="librados_8h_1a64dcfef30633e15facadfd9214f46792"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_blocklist_add</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client_address</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">expire_seconds</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_blocklist_add" title="Permalink to this definition"></a><br /></dt>
<dd><p>Blocklists the specified client from the OSDs</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
<li><p><strong>client_address</strong> -- client address </p></li>
<li><p><strong>expire_seconds</strong> -- number of seconds to blocklist (0 for default) </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_blacklist_add">
<span class="target" id="librados_8h_1a0f965cd68a30470e40fa1ba3de1ec28b"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_blacklist_add</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">client_address</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">expire_seconds</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_blacklist_add" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_getaddrs">
<span class="target" id="librados_8h_1a655e43e99e91e373d3503bb0ef956f3c"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_getaddrs</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_t" title="rados_t"><span class="n"><span class="pre">rados_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">cluster</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">addrs</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_getaddrs" title="Permalink to this definition"></a><br /></dt>
<dd><p>Gets addresses of the RADOS session, suitable for blocklisting.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cluster</strong> -- cluster handle </p></li>
<li><p><strong>addrs</strong> -- the output string. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_set_osdmap_full_try">
<span class="target" id="librados_8h_1aaa9189b057055a2ef6c2dce6d20acc7e"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_set_osdmap_full_try</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_set_osdmap_full_try" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_unset_osdmap_full_try">
<span class="target" id="librados_8h_1a8cd5625ef1506f6814beeaae2ff389ec"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_unset_osdmap_full_try</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_unset_osdmap_full_try" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_set_pool_full_try">
<span class="target" id="librados_8h_1a7425987061d85e84af177b1a25e11703"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_set_pool_full_try</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_set_pool_full_try" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_unset_pool_full_try">
<span class="target" id="librados_8h_1a4c9f63fdd34c28f683e34c7e4f427072"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_unset_pool_full_try</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_unset_pool_full_try" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_application_enable">
<span class="target" id="librados_8h_1a52ca624ea076e7b559b70e8e43b7c645"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_application_enable</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">app_name</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">force</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_application_enable" title="Permalink to this definition"></a><br /></dt>
<dd><p>Enable an application on a pool</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- pool ioctx </p></li>
<li><p><strong>app_name</strong> -- application name </p></li>
<li><p><strong>force</strong> -- 0 if only single application per pool </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_application_list">
<span class="target" id="librados_8h_1ab7668375319ea35571b38b707c59bd73"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_application_list</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">values</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">values_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_application_list" title="Permalink to this definition"></a><br /></dt>
<dd><p>List all enabled applications</p>
<p>If the provided buffer is too short, the required length is filled in and -ERANGE is returned. Otherwise, the buffers are filled with the application names, with a ‘\0’ after each.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- pool ioctx </p></li>
<li><p><strong>values</strong> -- buffer in which to store application names </p></li>
<li><p><strong>values_len</strong> -- number of bytes in values buffer </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ERANGE if either buffer is too short </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_application_metadata_get">
<span class="target" id="librados_8h_1a6a337b9b7cb022364127853d0f55d3d4"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_application_metadata_get</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">app_name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_application_metadata_get" title="Permalink to this definition"></a><br /></dt>
<dd><p>Get application metadata value from pool</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- pool ioctx </p></li>
<li><p><strong>app_name</strong> -- application name </p></li>
<li><p><strong>key</strong> -- metadata key </p></li>
<li><p><strong>value</strong> -- result buffer </p></li>
<li><p><strong>value_len</strong> -- maximum len of value </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_application_metadata_set">
<span class="target" id="librados_8h_1a2a67d1e53164d17725f741c494e036ac"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_application_metadata_set</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">app_name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_application_metadata_set" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set application metadata on a pool</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- pool ioctx </p></li>
<li><p><strong>app_name</strong> -- application name </p></li>
<li><p><strong>key</strong> -- metadata key </p></li>
<li><p><strong>value</strong> -- metadata key </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_application_metadata_remove">
<span class="target" id="librados_8h_1a46f6cdd04de17420a41360d1fe8a0c0a"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_application_metadata_remove</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">app_name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_application_metadata_remove" title="Permalink to this definition"></a><br /></dt>
<dd><p>Remove application metadata from a pool</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- pool ioctx </p></li>
<li><p><strong>app_name</strong> -- application name </p></li>
<li><p><strong>key</strong> -- metadata key </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_application_metadata_list">
<span class="target" id="librados_8h_1a51ac95244f6b57a123edb952fb8ccb51"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_application_metadata_list</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">app_name</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">keys</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key_len</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">values</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">vals_len</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.rados_application_metadata_list" title="Permalink to this definition"></a><br /></dt>
<dd><p>List all metadata key/value pairs associated with an application.</p>
<p>This iterates over all metadata, key_len and val_len are filled in with the number of bytes put into the keys and values buffers.</p>
<p>If the provided buffers are too short, the required lengths are filled in and -ERANGE is returned. Otherwise, the buffers are filled with the keys and values of the metadata, with a ‘\0’ after each.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>io</strong> -- pool ioctx </p></li>
<li><p><strong>app_name</strong> -- application name </p></li>
<li><p><strong>keys</strong> -- buffer in which to store key names </p></li>
<li><p><strong>key_len</strong> -- number of bytes in keys buffer </p></li>
<li><p><strong>values</strong> -- buffer in which to store values </p></li>
<li><p><strong>vals_len</strong> -- number of bytes in values buffer </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success, negative error code on failure </p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>-ERANGE if either buffer is too short </p>
</dd>
</dl>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_objects_list_open">
<span class="target" id="librados_8h_1adbbcebecfdcdfe15b8fff79c0f1b465b"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_objects_list_open</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_ioctx_t" title="rados_ioctx_t"><span class="n"><span class="pre">rados_ioctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">io</span></span>, <a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">ctx</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_objects_list_open" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_objects_list_get_pg_hash_position">
<span class="target" id="librados_8h_1a3657214de8490c31925f981a55274e32"></span><span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_objects_list_get_pg_hash_position</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">ctx</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_objects_list_get_pg_hash_position" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_objects_list_seek">
<span class="target" id="librados_8h_1a9a6e63627df563e7a2727951a1e103b8"></span><span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_objects_list_seek</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">ctx</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">pos</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_objects_list_seek" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_objects_list_next">
<span class="target" id="librados_8h_1aa9c244c94c1f1ac600bb4b7a2cf7bf18"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_objects_list_next</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">ctx</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">entry</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">key</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_objects_list_next" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.rados_objects_list_close">
<span class="target" id="librados_8h_1a69ad3780320ac6e1db46e31689724b0c"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_objects_list_close</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.rados_list_ctx_t" title="rados_list_ctx_t"><span class="n"><span class="pre">rados_list_ctx_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">ctx</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="pre">__attribute__((deprecated))</span><a class="headerlink" href="#c.rados_objects_list_close" title="Permalink to this definition"></a><br /></dt>
<dd></dd></dl>

</div>
<dl class="c struct">
<dt class="sig sig-object c" id="c.rados_object_list_item">
<span class="target" id="structrados__object__list__item"></span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_object_list_item</span></span></span><a class="headerlink" href="#c.rados_object_list_item" title="Permalink to this definition"></a><br /></dt>
<dd><div class="docutils container">
<em>#include &lt;librados.h&gt;</em></div>
<p>The item populated by rados_object_list in the results array. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c" id="c.rados_object_list_item.oid_length">
<span class="target" id="structrados__object__list__item_1ab435d1c0f7cfac2dbd6be0c2a3ab438e"></span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">oid_length</span></span></span><a class="headerlink" href="#c.rados_object_list_item.oid_length" title="Permalink to this definition"></a><br /></dt>
<dd><p>oid length </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_object_list_item.oid">
<span class="target" id="structrados__object__list__item_1a8f579ff1575094f48ef759e5814c55de"></span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">oid</span></span></span><a class="headerlink" href="#c.rados_object_list_item.oid" title="Permalink to this definition"></a><br /></dt>
<dd><p>name of the object </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_object_list_item.nspace_length">
<span class="target" id="structrados__object__list__item_1aa717865eb172ba1f7054796fafcebc28"></span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">nspace_length</span></span></span><a class="headerlink" href="#c.rados_object_list_item.nspace_length" title="Permalink to this definition"></a><br /></dt>
<dd><p>namespace length </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_object_list_item.nspace">
<span class="target" id="structrados__object__list__item_1a3efdaa04909dc96ca679e9c1c908d0c6"></span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">nspace</span></span></span><a class="headerlink" href="#c.rados_object_list_item.nspace" title="Permalink to this definition"></a><br /></dt>
<dd><p>the object namespace </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_object_list_item.locator_length">
<span class="target" id="structrados__object__list__item_1a37a4a7c93e674c5a6ff6eb1d3775054d"></span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">locator_length</span></span></span><a class="headerlink" href="#c.rados_object_list_item.locator_length" title="Permalink to this definition"></a><br /></dt>
<dd><p>locator length </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_object_list_item.locator">
<span class="target" id="structrados__object__list__item_1a167c9fab6a08d37c4959abb447f4e927"></span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">locator</span></span></span><a class="headerlink" href="#c.rados_object_list_item.locator" title="Permalink to this definition"></a><br /></dt>
<dd><p>object locator </p>
</dd></dl>

</div>
</dd></dl>

<dl class="c struct">
<dt class="sig sig-object c" id="c.rados_pool_stat_t">
<span class="target" id="structrados__pool__stat__t"></span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_pool_stat_t</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t" title="Permalink to this definition"></a><br /></dt>
<dd><div class="docutils container">
<em>#include &lt;librados.h&gt;</em></div>
<p>Usage information for a pool. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_bytes">
<span class="target" id="structrados__pool__stat__t_1ae6385fec35785692a72ded4521051349"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_bytes</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_bytes" title="Permalink to this definition"></a><br /></dt>
<dd><p>space used in bytes </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_kb">
<span class="target" id="structrados__pool__stat__t_1ab9dfedb097f054908307faaa66b7e109"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_kb</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_kb" title="Permalink to this definition"></a><br /></dt>
<dd><p>space used in KB </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_objects">
<span class="target" id="structrados__pool__stat__t_1ad0f3fc2289e2242e4d81475b3b9c6ee7"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_objects</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_objects" title="Permalink to this definition"></a><br /></dt>
<dd><p>number of objects in the pool </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_object_clones">
<span class="target" id="structrados__pool__stat__t_1a934a353ee4ee657b1e47b66ffc99ee02"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_object_clones</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_object_clones" title="Permalink to this definition"></a><br /></dt>
<dd><p>number of clones of objects </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_object_copies">
<span class="target" id="structrados__pool__stat__t_1a3e537978ffb81be0a6355f3bb6159290"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_object_copies</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_object_copies" title="Permalink to this definition"></a><br /></dt>
<dd><p>num_objects * num_replicas </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_objects_missing_on_primary">
<span class="target" id="structrados__pool__stat__t_1a2f0995af81b64c8678dc4bdecd42a8c5"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_objects_missing_on_primary</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_objects_missing_on_primary" title="Permalink to this definition"></a><br /></dt>
<dd><p>number of objects missing on primary </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_objects_unfound">
<span class="target" id="structrados__pool__stat__t_1a1be8f89a42f68ef7f25d5dcf728ea7b0"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_objects_unfound</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_objects_unfound" title="Permalink to this definition"></a><br /></dt>
<dd><p>number of objects found on no OSDs </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_objects_degraded">
<span class="target" id="structrados__pool__stat__t_1af63ab0187a498098d898f4dd1b49cb5c"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_objects_degraded</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_objects_degraded" title="Permalink to this definition"></a><br /></dt>
<dd><p>number of objects replicated fewer times than they should be (but found on at least one OSD) </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_rd">
<span class="target" id="structrados__pool__stat__t_1aca0e0d878b451946c96a8f0fb46075df"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_rd</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_rd" title="Permalink to this definition"></a><br /></dt>
<dd><p>number of objects read </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_rd_kb">
<span class="target" id="structrados__pool__stat__t_1abef90de3656e1aa464e70661bff8220b"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_rd_kb</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_rd_kb" title="Permalink to this definition"></a><br /></dt>
<dd><p>objects read in KB </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_wr">
<span class="target" id="structrados__pool__stat__t_1a8c77f7bf4c192e522df7496288f23f8f"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_wr</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_wr" title="Permalink to this definition"></a><br /></dt>
<dd><p>number of objects written </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_wr_kb">
<span class="target" id="structrados__pool__stat__t_1af56c7186ba19df57f7978b6ce734361a"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_wr_kb</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_wr_kb" title="Permalink to this definition"></a><br /></dt>
<dd><p>objects written in KB </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.num_user_bytes">
<span class="target" id="structrados__pool__stat__t_1ac3cdc6d239589395eea0a934e360524a"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_user_bytes</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.num_user_bytes" title="Permalink to this definition"></a><br /></dt>
<dd><p>bytes originally provided by user </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.compressed_bytes_orig">
<span class="target" id="structrados__pool__stat__t_1a1bd4f859b702a6d5be49360a9865d02d"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">compressed_bytes_orig</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.compressed_bytes_orig" title="Permalink to this definition"></a><br /></dt>
<dd><p>bytes passed compression </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.compressed_bytes">
<span class="target" id="structrados__pool__stat__t_1a3cb887b369cc7ec4a564d1d9b4f1deb1"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">compressed_bytes</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.compressed_bytes" title="Permalink to this definition"></a><br /></dt>
<dd><p>bytes resulted after compression </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_pool_stat_t.compressed_bytes_alloc">
<span class="target" id="structrados__pool__stat__t_1adcd6e409132948151e3d902bb79dd294"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">compressed_bytes_alloc</span></span></span><a class="headerlink" href="#c.rados_pool_stat_t.compressed_bytes_alloc" title="Permalink to this definition"></a><br /></dt>
<dd><p>bytes allocated at storage </p>
</dd></dl>

</div>
</dd></dl>

<dl class="c struct">
<dt class="sig sig-object c" id="c.rados_cluster_stat_t">
<span class="target" id="structrados__cluster__stat__t"></span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rados_cluster_stat_t</span></span></span><a class="headerlink" href="#c.rados_cluster_stat_t" title="Permalink to this definition"></a><br /></dt>
<dd><div class="docutils container">
<em>#include &lt;librados.h&gt;</em></div>
<p>Cluster-wide usage information </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt class="sig sig-object c" id="c.rados_cluster_stat_t.kb">
<span class="target" id="structrados__cluster__stat__t_1a37633ef0eb7d786d06869a7401167966"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">kb</span></span></span><a class="headerlink" href="#c.rados_cluster_stat_t.kb" title="Permalink to this definition"></a><br /></dt>
<dd><p>total device size </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_cluster_stat_t.kb_used">
<span class="target" id="structrados__cluster__stat__t_1ac2c7d8f0977feed733742e5a1d046f5e"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">kb_used</span></span></span><a class="headerlink" href="#c.rados_cluster_stat_t.kb_used" title="Permalink to this definition"></a><br /></dt>
<dd><p>total used </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_cluster_stat_t.kb_avail">
<span class="target" id="structrados__cluster__stat__t_1aeb381150d5a01aeb57015512d820b302"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">kb_avail</span></span></span><a class="headerlink" href="#c.rados_cluster_stat_t.kb_avail" title="Permalink to this definition"></a><br /></dt>
<dd><p>total available/free </p>
</dd></dl>

<dl class="c var">
<dt class="sig sig-object c" id="c.rados_cluster_stat_t.num_objects">
<span class="target" id="structrados__cluster__stat__t_1addd82ed2ef92adc7ecb8c051ad68bd66"></span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">num_objects</span></span></span><a class="headerlink" href="#c.rados_cluster_stat_t.num_objects" title="Permalink to this definition"></a><br /></dt>
<dd><p>number of objects </p>
</dd></dl>

</div>
</dd></dl>

</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../librados-intro/" class="btn btn-neutral float-left" title="librados 简介" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../libradospp/" class="btn btn-neutral float-right" title="LibradosPP (C++)" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>